From eb2512d4a2f176742102e8fd4750ade1e02f215d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 11 Sep 2011 21:15:58 +0200 Subject: [PATCH] add timing information and setup remote = false by default Signed-off-by: Nico Schottelius --- bin/cdist | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/cdist b/bin/cdist index 4267b3fa..1e6fc45b 100755 --- a/bin/cdist +++ b/bin/cdist @@ -21,6 +21,7 @@ # import argparse +import datetime import logging import os import subprocess @@ -154,6 +155,7 @@ class Cdist: # and sh -c -e does not exit if /bin/false called args[0][:0] = [ "/bin/sh", "-e" ] + remote = false if "remote" in kargs: if kargs["remote"]: args[0][:0] = self.remote_prefix @@ -543,6 +545,7 @@ class Cdist: def deploy_to(self): """Mimic the old deploy to: Deploy to one host""" log.info("Deploying to " + self.target_host) + time_start = datetime.datetime.now() self.init_deploy() self.run_global_explores() self.run_initial_manifest() @@ -568,7 +571,11 @@ class Cdist: self.object_run(cdist_object, mode="gencode") 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__": parser = argparse.ArgumentParser(description='cdist ' + VERSION)