diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-08-07 15:11:55 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-08-07 15:11:55 +0000 |
commit | bb95ea862a35e6883b21e162b081beb813d0aabc (patch) | |
tree | f5b9dc0fc989444a9f75da32c848a75e55143df0 /src/lib/Server/Plugin.py | |
parent | fa65fe88b387747e0fa0b549a428adf0d94440b3 (diff) | |
download | bcfg2-bb95ea862a35e6883b21e162b081beb813d0aabc.tar.gz bcfg2-bb95ea862a35e6883b21e162b081beb813d0aabc.tar.bz2 bcfg2-bb95ea862a35e6883b21e162b081beb813d0aabc.zip |
Implement basic info.xml support
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3609 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r-- | src/lib/Server/Plugin.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 3c32dcad7..5f08934e8 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -276,12 +276,13 @@ class XMLSrc(XMLFileBacked): '''XMLSrc files contain a LNode hierarchy that returns matching entries''' __node__ = INode - def __init__(self, filename): + def __init__(self, filename, noprio='False'): XMLFileBacked.__init__(self, filename) self.items = {} self.cache = None self.pnode = None self.priority = -1 + self.noprio = noprio def HandleEvent(self, _=None): '''Read file upon update''' @@ -298,10 +299,11 @@ class XMLSrc(XMLFileBacked): return self.pnode = self.__node__(xdata, self.items) self.cache = None - try: - self.priority = int(xdata.get('priority')) - except (ValueError, TypeError): - logger.error("Got bogus priority %s for file %s" % (xdata.get('priority'), self.name)) + if not self.noprio: + try: + self.priority = int(xdata.get('priority')) + except (ValueError, TypeError): + logger.error("Got bogus priority %s for file %s" % (xdata.get('priority'), self.name)) del xdata, data def Cache(self, metadata): |