From 2e4c0d3465196b7f7b8d2d515326602a4d704ab6 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 7 Sep 2017 16:33:22 +0200 Subject: [PATCH] Improve dry run logging. --- cdist/config.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index d367b6ad..e33a6027 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -371,7 +371,8 @@ class Config(object): """Do what is most often done: deploy & cleanup""" start_time = time.time() - self.log.info("Starting configuration run") + self.log.info("Starting {} run".format( + 'dry' if self.dry_run else 'configuration')) self._init_files_dirs() @@ -382,7 +383,8 @@ class Config(object): self._remove_files_dirs() self.local.save_cache(start_time) - self.log.info("Finished successful run in {:.2f} seconds".format( + self.log.info("Finished {} run in {:.2f} seconds".format( + 'dry' if self.dry_run else 'successful', time.time() - start_time)) def cleanup(self): @@ -666,9 +668,6 @@ class Config(object): % (cdist_object.name)) self.code.transfer_code_remote(cdist_object) self.code.run_code_remote(cdist_object) - elif cdist_object.code_local or cdist_object.code_remote: - self.log.info("Skipping code execution for %s due to DRY RUN", - cdist_object.name) # Mark this object as done self.log.trace("Finishing run of " + cdist_object.name)