summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-11-23 14:33:50 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-11-23 14:33:50 +0000
commit21a85e34d327b27b243ae069aa1fffff382832ae (patch)
treef7dd3e3f7e5854316cd857bef3e3c4a2da1815df /src
parent820b2a677475e26aa29a23cd9c4eadcaf4ec4730 (diff)
downloadbcfg2-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')
-rw-r--r--src/lib/Client/Frame.py19
-rwxr-xr-xsrc/sbin/bcfg23
2 files changed, 12 insertions, 10 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'''
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index 67cfd8dbc..5f2094453 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -79,9 +79,6 @@ class Client:
if (self.setup["file"] != False) and (self.setup["cache"] != False):
print "cannot use -f and -c together"
raise SystemExit, 1
- if self.setup['remove'] and self.setup['dryrun']:
- print "cannot use -n and -r together"
- raise SystemExit, 1
def run_probe(self, probe):
'''Execute probe'''