From 4fd27e76a7ca4aea212097e4bdb6a12bded8ce0a Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Wed, 19 Dec 2012 19:37:43 +0100
Subject: [PATCH] support dry_run in stage_run_iterate as well

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 cdist/config_install.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cdist/config_install.py b/cdist/config_install.py
index b7662ad8..9de5ecb8 100644
--- a/cdist/config_install.py
+++ b/cdist/config_install.py
@@ -56,6 +56,9 @@ class ConfigInstall(object):
         self.manifest = core.Manifest(self.context.target_host, self.local)
         self.code = core.Code(self.context.target_host, self.local, self.remote)
 
+        # Add switch to disable code execution
+        self.dry_run = False
+
     def cleanup(self):
         # FIXME: move to local?
         destination = os.path.join(self.local.cache_path, self.context.target_host)
@@ -171,7 +174,7 @@ class ConfigInstall(object):
             if not cdist_object.state == cdist_object.STATE_DONE:
                 self.all_resolved = False
                 if cdist_object.satisfied_requirements:
-                    self.object_run(cdist_object)
+                    self.object_run(cdist_object, self.dry_run)
                     self.objects_changed = True
 
         # Not all are resolved, but nothing has been changed => bad dependencies!