summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorCalen Pennington <cpennington@wgen.net>2011-12-09 15:35:32 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-01-13 11:52:28 -0500
commitfaf3b60bfeb4382f818f5666ee54e82f342eaa71 (patch)
treebd8c3f4d0d89b8b65956a52cebd3cf874235c7c4 /src/lib
parent6db7cd19b6ea4f9aea785e84c3c178fdc163ba08 (diff)
downloadbcfg2-faf3b60bfeb4382f818f5666ee54e82f342eaa71.tar.gz
bcfg2-faf3b60bfeb4382f818f5666ee54e82f342eaa71.tar.bz2
bcfg2-faf3b60bfeb4382f818f5666ee54e82f342eaa71.zip
Use set differences, rather than list inclusion in Pkgmgr
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py
index bf674d0d0..a3890f2a5 100644
--- a/src/lib/Server/Plugins/Pkgmgr.py
+++ b/src/lib/Server/Plugins/Pkgmgr.py
@@ -5,6 +5,7 @@ import logging
import re
import Bcfg2.Server.Plugin
import lxml
+from sets import Set
logger = logging.getLogger('Bcfg2.Plugins.Pkgmgr')
@@ -63,8 +64,8 @@ class PNode(Bcfg2.Server.Plugin.INode):
if 'Package' not in pdict:
pdict['Package'] = set()
for child in data.getchildren():
- for attr in [key for key in list(data.attrib.keys())
- if key != 'name' and key not in child.attrib]:
+ attrs = Set(data.attrib.keys()).difference(child.attrib + ['name'])
+ for attr in attrs:
try:
child.set(attr, data.get(attr))
except: