From ed24c08e6cfa6093d8ff28585caddea08b96ee30 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 28 Sep 2009 20:59:02 +0000 Subject: Client Frame: Do not run updates for unspecified bundles (Fix for ticket #751) Do not allow client tool drivers to be called for bundles which are not specified when running in bundle mode (-b). I believe this case only shows up for Actions run always currently, however, we should keep the interface consistent and ignore unspecified bundles completely. Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5468 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Frame.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index 3228ab2c2..86d10cc5f 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -61,7 +61,7 @@ class Frame: isinstance(driver, str): self.logger.error("Tool driver %s is not available" % driver) drivers.remove(driver) - + tclass = {} for tool in drivers: if not isinstance(tool, str): @@ -101,8 +101,8 @@ class Frame: if tl: if not tl[0].VerifyConfigFile(cfile, []): if self.setup['interactive'] and not \ - promptFilter("Install %s: %s? (y/N):", [cfile]): - continue + promptFilter("Install %s: %s? (y/N):", [cfile]): + continue try: self.states[cfile] = tl[0].InstallConfigFile(cfile) except: @@ -133,8 +133,8 @@ class Frame: self.logger.debug([pkg[0] for pkg in pkgs if pkg[1] == None]) self.logger.debug("The following packages are prereqs added by Packages:") self.logger.debug([pkg[0] for pkg in pkgs if pkg[1] == 'Packages']) - - + + def __getattr__(self, name): if name in ['extra', 'handled', 'modified', '__important__']: ret = [] @@ -197,7 +197,7 @@ class Frame: self.logger.info("In blacklist mode: suppressing installation of:") self.logger.info(["%s:%s" % (e.tag, e.get('name')) for e in b_to_rem]) self.whitelist = [x for x in self.whitelist if x not in b_to_rem] - + if self.dryrun: if self.whitelist: self.logger.info("In dryrun mode: suppressing entry installation for:") @@ -254,8 +254,8 @@ class Frame: [self.whitelist.remove(ent) for ent in b_to_remv] if self.setup['interactive']: - self.whitelist = promptFilter(prompt, self.whitelist) - self.removal = promptFilter(rprompt, self.removal) + self.whitelist = promptFilter(prompt, self.whitelist) + self.removal = promptFilter(rprompt, self.removal) for entry in candidates: if entry not in self.whitelist: @@ -301,6 +301,9 @@ class Frame: self.DispatchInstallCalls(clobbered) for bundle in self.config.findall('.//Bundle'): + if self.setup['bundle'] and bundle not in self.setup['bundle']: + # prune out unspecified bundles when running with -b + continue for tool in self.tools: try: if bundle in mbundles: @@ -310,7 +313,7 @@ class Frame: except: self.logger.error("%s.BundleNotUpdated() call failed:" % \ (tool.name), exc_info=1) - + def Remove(self): '''Remove extra entries''' for tool in self.tools: @@ -334,7 +337,7 @@ class Frame: if phase == 'final' and self.setup['extra']: self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) \ for entry in self.extra]) - + self.logger.info("") if ((list(self.states.values()).count(False) == 0) and not self.extra): -- cgit v1.2.3-1-g7c22