summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-10-24 19:52:58 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-10-24 19:52:58 +0000
commitd80e741961715582fda0c4379f5e7b563caaeba3 (patch)
treecb49c931182c4aaf30f94d9997ded4d855f59041 /src/lib/Client/Tools
parent46b5888728132fabacb79dc7a28a34f248526460 (diff)
downloadbcfg2-d80e741961715582fda0c4379f5e7b563caaeba3.tar.gz
bcfg2-d80e741961715582fda0c4379f5e7b563caaeba3.tar.bz2
bcfg2-d80e741961715582fda0c4379f5e7b563caaeba3.zip
Action: Implement per-action toggle to prevent execution in build mode (Resolves Ticket #747) (can set build='false' in actions to suppress execution in build mode)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5501 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r--src/lib/Client/Tools/Action.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/Client/Tools/Action.py b/src/lib/Client/Tools/Action.py
index 02fd76c99..c196f5df4 100644
--- a/src/lib/Client/Tools/Action.py
+++ b/src/lib/Client/Tools/Action.py
@@ -22,6 +22,10 @@ class Action(Bcfg2.Client.Tools.Tool):
prompt = 'Run Action %s, %s: (y/N): ' % (entry.get('name'), entry.get('command'))
if raw_input(prompt) not in ['y', 'Y']:
return False
+ if self.setup['servicemode'] == 'build':
+ if entry.get('build', 'true') == 'false':
+ self.logger.debug("Action: Deferring execution of %s due to build mode" % (entry.get('command')))
+ return False
self.logger.debug("Running Action %s" % (entry.get('name')))
rc = self.cmd.run(entry.get('command'))[0]
self.logger.debug("Action: %s got rc %s" % (entry.get('command'), rc))