diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2013-06-28 19:00:42 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-06-28 19:00:42 -0500 |
commit | bf802098f3ba62bbd443a53f55be2c0c156ba4e2 (patch) | |
tree | 2aec221d219e85d889afa5ea7a6fdcf4d25557e4 /src/lib | |
parent | 251dc8aaa9ff7525d0df64c70d9e607ac39cdf0d (diff) | |
parent | c715a661fece0e2e561d4d62a27e9bdac212c54a (diff) | |
download | bcfg2-bf802098f3ba62bbd443a53f55be2c0c156ba4e2.tar.gz bcfg2-bf802098f3ba62bbd443a53f55be2c0c156ba4e2.tar.bz2 bcfg2-bf802098f3ba62bbd443a53f55be2c0c156ba4e2.zip |
Merge branch 'python-pre27-compat' of https://github.com/AlexanderS/bcfg2 into maint
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Client/Frame.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py index 6bef77081..3254da9e9 100644 --- a/src/lib/Bcfg2/Client/Frame.py +++ b/src/lib/Bcfg2/Client/Frame.py @@ -207,7 +207,15 @@ class Frame(object): # take care of important entries first if not self.dryrun: - for parent in self.config.findall(".//Path/.."): + parent_map = dict((c, p) + for p in self.config.getiterator() + for c in p) + for cfile in self.config.findall(".//Path"): + if (cfile.get('name') not in self.__important__ or + cfile.get('type') != 'file' or + cfile not in self.whitelist): + continue + parent = parent_map[cfile] if ((parent.tag == "Bundle" and ((self.setup['bundle'] and parent.get("name") not in self.setup['bundle']) or @@ -216,15 +224,9 @@ class Frame(object): (parent.tag == "Independent" and (self.setup['bundle'] or self.setup['skipindep']))): continue - for cfile in parent.findall("./Path"): - if (cfile.get('name') not in self.__important__ or - cfile.get('type') != 'file' or - cfile not in self.whitelist): - continue - tools = [t for t in self.tools - if t.handlesEntry(cfile) and t.canVerify(cfile)] - if not tools: - continue + tools = [t for t in self.tools + if t.handlesEntry(cfile) and t.canVerify(cfile)] + if tools: if (self.setup['interactive'] and not self.promptFilter("Install %s: %s? (y/N):", [cfile])): self.whitelist.remove(cfile) |