diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2013-01-15 12:56:07 -0600 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-01-15 12:56:07 -0600 |
commit | 029ff311c5560ac7231c6852d872b951aad9b0e6 (patch) | |
tree | 32d7e916560bcbe15d007806d2c3144ccfd200ee /src/lib/Bcfg2/Client/Frame.py | |
parent | d29ef6b04487d321049774bbdb3ad4dfd0d306ed (diff) | |
parent | 38f55b6257ce51b1cf65ecb3d980d7528c1b53ff (diff) | |
download | bcfg2-029ff311c5560ac7231c6852d872b951aad9b0e6.tar.gz bcfg2-029ff311c5560ac7231c6852d872b951aad9b0e6.tar.bz2 bcfg2-029ff311c5560ac7231c6852d872b951aad9b0e6.zip |
Merge branch 'getparent' of https://github.com/zenazn/bcfg2
From the pull request:
getparent() only works if you have lxml.etree installed—xml.etree
in the Python standard library (the fallback include) doesn't support
this method.
Diffstat (limited to 'src/lib/Bcfg2/Client/Frame.py')
-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) |