diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-03-10 16:17:11 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-03-10 16:17:11 +0000 |
commit | 16891d0b7013be09944c9f0e383ea4f133a00b2b (patch) | |
tree | e3f164891e7e9572a6e9c810caed34c154a6b306 /src/lib/Client/Tools/Action.py | |
parent | 05eb7b35cf0c2a86707005ca0e04a6cd5b5ba8f9 (diff) | |
download | bcfg2-16891d0b7013be09944c9f0e383ea4f133a00b2b.tar.gz bcfg2-16891d0b7013be09944c9f0e383ea4f133a00b2b.tar.bz2 bcfg2-16891d0b7013be09944c9f0e383ea4f133a00b2b.zip |
Properly integrate actions into Interactive mode (Resolves Ticket #414)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2922 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/Action.py')
-rw-r--r-- | src/lib/Client/Tools/Action.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/Client/Tools/Action.py b/src/lib/Client/Tools/Action.py index a1121eb15..a69405764 100644 --- a/src/lib/Client/Tools/Action.py +++ b/src/lib/Client/Tools/Action.py @@ -17,6 +17,10 @@ class Action(Bcfg2.Client.Tools.Tool): def RunAction(self, entry): '''This method handles command execution and status return''' + if self.setup['interactive']: + prompt = 'Run Action %s, %s: (N/y): ' % (entry.get('name'), entry.get('command')) + if raw_input(prompt) not in ['y', 'Y']: + 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)) |