summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-28 23:47:27 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-06-28 23:47:27 +0200
commitaed992e317378569abfdc75e0da195e56445db19 (patch)
tree9388587b778e9dfd0507e202db0d3e9d4925a9c7
parent1c2f6df17aeeb5af01a75e959e7c71aedf4df6a8 (diff)
downloadbcfg2-aed992e317378569abfdc75e0da195e56445db19.tar.gz
bcfg2-aed992e317378569abfdc75e0da195e56445db19.tar.bz2
bcfg2-aed992e317378569abfdc75e0da195e56445db19.zip
Revert "Avoid use of lxml-only getparent()"
This reverts commit 38f55b6257ce51b1cf65ecb3d980d7528c1b53ff.
-rw-r--r--src/lib/Bcfg2/Client/Frame.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py
index 6bef77081..edbc9f055 100644
--- a/src/lib/Bcfg2/Client/Frame.py
+++ b/src/lib/Bcfg2/Client/Frame.py
@@ -207,7 +207,12 @@ class Frame(object):
# take care of important entries first
if not self.dryrun:
- for parent in self.config.findall(".//Path/.."):
+ 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 = cfile.getparent()
if ((parent.tag == "Bundle" and
((self.setup['bundle'] and
parent.get("name") not in self.setup['bundle']) or
@@ -216,15 +221,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)