summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Server/Lint/Pkgmgr.py20
-rw-r--r--src/lib/Server/Plugin.py3
2 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/Server/Lint/Pkgmgr.py b/src/lib/Server/Lint/Pkgmgr.py
index 3960a8cf9..8f099163a 100644
--- a/src/lib/Server/Lint/Pkgmgr.py
+++ b/src/lib/Server/Lint/Pkgmgr.py
@@ -1,21 +1,19 @@
+import glob
+import lxml.etree
import Bcfg2.Server.Lint
-class Pkgmgr(Bcfg2.Server.Lint.ServerPlugin):
+class Pkgmgr(Bcfg2.Server.Lint.ServerlessPlugin):
""" find duplicate Pkgmgr entries with the same priority """
def Run(self):
- if 'Pkgmgr' not in self.core.plugins:
- self.logger.info("Pkgmgr server plugin is not enabled, skipping Pkgmgr lint checks")
- return
-
pset = set()
- for plist in self.core.plugins['Pkgmgr'].entries.values():
- if self.HandlesFile(plist.name):
- xdata = plist.data
+ for pfile in glob.glob("%s/Pkgmgr/*.xml" % self.config['repo']):
+ if self.HandlesFile(pfile):
+ xdata = lxml.etree.parse(pfile).getroot()
# get priority, type, group
- priority = xdata.getroot().get('priority')
- ptype = xdata.getroot().get('type')
- for pkg in xdata.findall("//Package"):
+ priority = xdata.get('priority')
+ ptype = xdata.get('type')
+ for pkg in xdata.xpath("//Package"):
if pkg.getparent().tag == 'Group':
grp = pkg.getparent().get('name')
if (type(grp) is not str and
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 1d473fdb7..82b23d21f 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -789,6 +789,9 @@ class XMLSrc(XMLFileBacked):
self.pnode.Match(metadata, cache[1])
self.cache = cache
+ def __str__(self):
+ return str(self.items)
+
class InfoXML (XMLSrc):
__node__ = InfoNode