add timing information and setup remote = false by default

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-11 21:15:58 +02:00
parent f9f874deed
commit eb2512d4a2
1 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,7 @@
# #
import argparse import argparse
import datetime
import logging import logging
import os import os
import subprocess import subprocess
@ -154,6 +155,7 @@ class Cdist:
# and sh -c -e does not exit if /bin/false called # and sh -c -e does not exit if /bin/false called
args[0][:0] = [ "/bin/sh", "-e" ] args[0][:0] = [ "/bin/sh", "-e" ]
remote = false
if "remote" in kargs: if "remote" in kargs:
if kargs["remote"]: if kargs["remote"]:
args[0][:0] = self.remote_prefix args[0][:0] = self.remote_prefix
@ -543,6 +545,7 @@ class Cdist:
def deploy_to(self): def deploy_to(self):
"""Mimic the old deploy to: Deploy to one host""" """Mimic the old deploy to: Deploy to one host"""
log.info("Deploying to " + self.target_host) log.info("Deploying to " + self.target_host)
time_start = datetime.datetime.now()
self.init_deploy() self.init_deploy()
self.run_global_explores() self.run_global_explores()
self.run_initial_manifest() self.run_initial_manifest()
@ -568,7 +571,11 @@ class Cdist:
self.object_run(cdist_object, mode="gencode") self.object_run(cdist_object, mode="gencode")
self.object_run(cdist_object, mode="code") self.object_run(cdist_object, mode="code")
log.info("Finished run of %s", self.target_host) time_end = datetime.datetime.now()
duration = time_end - time_start
log.info("Finished run of %s in %s seconds",
self.target_host,
duration.total_seconds())
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='cdist ' + VERSION) parser = argparse.ArgumentParser(description='cdist ' + VERSION)