summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-29 00:04:34 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-06-29 00:04:34 +0200
commit8ef8686436bbb626af7dc56ed03347261e7f3052 (patch)
tree934ed85cd50eefaf0969430e370c222f430e5436
parent481b993ae62f3839291f0319c8f0b9e963effba8 (diff)
parentc715a661fece0e2e561d4d62a27e9bdac212c54a (diff)
downloadbcfg2-1.3.1-spline1.tar.gz
bcfg2-1.3.1-spline1.tar.bz2
bcfg2-1.3.1-spline1.zip
Merge remote branch 'github/python-pre27-compat' into splinev1.3.1-spline1
* github/python-pre27-compat: Client/Frame: avoid use of lxml-only getparent() Revert "Avoid use of lxml-only getparent()"
-rw-r--r--src/lib/Bcfg2/Client/Frame.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py
index bf0b20f87..24b4f409c 100644
--- a/src/lib/Bcfg2/Client/Frame.py
+++ b/src/lib/Bcfg2/Client/Frame.py
@@ -211,7 +211,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
@@ -220,15 +228,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)