diff options
author | Carl Jackson <carl@avtok.com> | 2013-01-14 00:13:37 -0500 |
---|---|---|
committer | Carl Jackson <carl@avtok.com> | 2013-01-14 00:13:37 -0500 |
commit | 38f55b6257ce51b1cf65ecb3d980d7528c1b53ff (patch) | |
tree | 07925568d87579463ecc4728e2e20f1788f7d18e | |
parent | 51ee994ac3429493f727fcb1722d3fe7023c2af4 (diff) | |
download | bcfg2-38f55b6257ce51b1cf65ecb3d980d7528c1b53ff.tar.gz bcfg2-38f55b6257ce51b1cf65ecb3d980d7528c1b53ff.tar.bz2 bcfg2-38f55b6257ce51b1cf65ecb3d980d7528c1b53ff.zip |
Avoid use of lxml-only getparent()
-rw-r--r-- | src/lib/Bcfg2/Client/Frame.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py index 4f3ff1820..a95c0a7a6 100644 --- a/src/lib/Bcfg2/Client/Frame.py +++ b/src/lib/Bcfg2/Client/Frame.py @@ -228,12 +228,7 @@ class Frame(object): # take care of important entries first if not self.dryrun: - 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() + for parent in self.config.findall(".//Path/.."): if ((parent.tag == "Bundle" and ((self.setup['bundle'] and parent.get("name") not in self.setup['bundle']) or @@ -242,9 +237,15 @@ class Frame(object): (parent.tag == "Independent" and (self.setup['bundle'] or self.setup['skipindep']))): continue - tools = [t for t in self.tools - if t.handlesEntry(cfile) and t.canVerify(cfile)] - if tools: + 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 if (self.setup['interactive'] and not self.promptFilter("Install %s: %s? (y/N):", [cfile])): self.whitelist.remove(cfile) |