From a3dea70a97e60917f1e2f124985f7b77a0193feb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 26 Nov 2013 16:14:44 +0100 Subject: [PATCH] Revert "first generate and execute *-local, then *-remote" This reverts commit cf22499538266b1b4fac1694254edfd8ba9be68d. --- cdist/config.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index 89f3e325..7e003835 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -248,30 +248,24 @@ class Config(object): cdist_type = cdist_object.cdist_type + # Generate self.log.info("Generating and executing code for %s" % (cdist_object.name)) - - # local cdist_object.code_local = self.code.run_gencode_local(cdist_object) - if cdist_object.code_local: - cdist_object.changed = True - if not self.dry_run: - self.code.run_code_local(cdist_object) - else: - self.log.info("Skipping code execution due to DRY RUN") - - # remote cdist_object.code_remote = self.code.run_gencode_remote(cdist_object) - if cdist_object.code_remote: - cdist_object.changed = True - if not self.dry_run: - self.code.transfer_code_remote(cdist_object) - self.code.run_code_remote(cdist_object) - else: - self.log.info("Skipping code execution due to DRY RUN") - if cdist_object.code_local or cdist_object.code_remote: cdist_object.changed = True + # Execute + if not self.dry_run: + if cdist_object.code_local: + self.code.run_code_local(cdist_object) + if cdist_object.code_remote: + self.code.transfer_code_remote(cdist_object) + self.code.run_code_remote(cdist_object) + else: + self.log.info("Skipping code execution due to DRY RUN") + + # Mark this object as done self.log.debug("Finishing run of " + cdist_object.name) cdist_object.state = core.CdistObject.STATE_DONE