From d80e741961715582fda0c4379f5e7b563caaeba3 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sat, 24 Oct 2009 19:52:58 +0000 Subject: 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 --- src/lib/Client/Tools/Action.py | 4 ++++ 1 file changed, 4 insertions(+) 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)) -- cgit v1.2.3-1-g7c22