diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-09-28 20:59:02 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-09-28 20:59:02 +0000 |
commit | ed24c08e6cfa6093d8ff28585caddea08b96ee30 (patch) | |
tree | f785024ce7af5574acc6932c693e519847c97e1b /src/lib/Client | |
parent | 01f103ce62342831afb5efc9f9e4bc07c1c06b15 (diff) | |
download | bcfg2-ed24c08e6cfa6093d8ff28585caddea08b96ee30.tar.gz bcfg2-ed24c08e6cfa6093d8ff28585caddea08b96ee30.tar.bz2 bcfg2-ed24c08e6cfa6093d8ff28585caddea08b96ee30.zip |
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 <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5468 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Frame.py | 23 |
1 files changed, 13 insertions, 10 deletions
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): |