diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-11-23 14:33:50 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-11-23 14:33:50 +0000 |
commit | 21a85e34d327b27b243ae069aa1fffff382832ae (patch) | |
tree | f7dd3e3f7e5854316cd857bef3e3c4a2da1815df /src/lib/Client/Frame.py | |
parent | 820b2a677475e26aa29a23cd9c4eadcaf4ec4730 (diff) | |
download | bcfg2-21a85e34d327b27b243ae069aa1fffff382832ae.tar.gz bcfg2-21a85e34d327b27b243ae069aa1fffff382832ae.tar.bz2 bcfg2-21a85e34d327b27b243ae069aa1fffff382832ae.zip |
Allow bcfg2 -n -r all to work properly (Resolves Ticket #284)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2534 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Frame.py')
-rw-r--r-- | src/lib/Client/Frame.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index 5fe2c91e5..3ec2cb25a 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -83,10 +83,22 @@ class Frame: '''Set self.whitelist based on user interaction''' prompt = "Would you like to install %s: %s? (y/N): " rprompt = "Would you like to remove %s: %s? (y/N): " + if self.setup['remove']: + if self.setup['remove'] == 'all': + self.removal = self.extra + elif self.setup['remove'] == 'services': + self.removal = [entry for entry in self.extra if entry.tag == 'Service'] + elif self.setup['remove'] == 'packages': + self.removal = [entry for entry in self.extra if entry.tag == 'Package'] + if self.setup['dryrun']: self.logger.info("In dryrun mode: suppressing entry installation for:") self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ in self.states if not self.states[entry]]) + self.logger.info("In dryrun mode: suppressing entry removal for:") + self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ + in self.removal]) + self.removal = [] return elif self.setup['interactive']: self.whitelist = promptFilter(prompt, [entry for entry in self.states \ @@ -104,13 +116,6 @@ class Frame: else: # all systems are go self.whitelist = [entry for entry in self.states if not self.states[entry]] - if self.setup['remove']: - if self.setup['remove'] == 'all': - self.removal = self.extra - elif self.setup['remove'] == 'services': - self.removal = [entry for entry in self.extra if entry.tag == 'Service'] - elif self.setup['remove'] == 'packages': - self.removal = [entry for entry in self.extra if entry.tag == 'Package'] def DispatchInstallCalls(self, entries): '''Dispatch install calls to underlying tools''' |