From 80b4ca09bf4a815efd0726b96e3d032f76e1366d Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 22 Aug 2012 16:54:49 -0400 Subject: do not require a priority attribute on InfoXML files at all --- src/lib/Bcfg2/Server/Plugin.py | 9 +++++---- src/lib/Bcfg2/Server/Plugins/Cfg/CfgInfoXML.py | 2 +- src/lib/Bcfg2/Server/Plugins/SSLCA.py | 3 +-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py index 97892c42d..f858c7b44 100644 --- a/src/lib/Bcfg2/Server/Plugin.py +++ b/src/lib/Bcfg2/Server/Plugin.py @@ -852,14 +852,14 @@ class XMLSrc(XMLFileBacked): """XMLSrc files contain a LNode hierarchy that returns matching entries.""" __node__ = INode __cacheobj__ = dict + __priority_required__ = True - def __init__(self, filename, fam=None, should_monitor=False, noprio=False): + def __init__(self, filename, fam=None, should_monitor=False): XMLFileBacked.__init__(self, filename, fam, should_monitor) self.items = {} self.cache = None self.pnode = None self.priority = -1 - self.noprio = noprio def HandleEvent(self, _=None): """Read file upon update.""" @@ -881,7 +881,7 @@ class XMLSrc(XMLFileBacked): try: self.priority = int(xdata.get('priority')) except (ValueError, TypeError): - if not self.noprio: + if self.__priority_required__: msg = "Got bogus priority %s for file %s" % \ (xdata.get('priority'), self.name) logger.error(msg) @@ -906,6 +906,7 @@ class XMLSrc(XMLFileBacked): class InfoXML(XMLSrc): __node__ = InfoNode + __priority_required__ = False class XMLDirectoryBacked(DirectoryBacked): @@ -1173,7 +1174,7 @@ class EntrySet(Debuggable): fpath = os.path.join(self.path, event.filename) if event.filename == 'info.xml': if not self.infoxml: - self.infoxml = InfoXML(fpath, True) + self.infoxml = InfoXML(fpath) self.infoxml.HandleEvent(event) elif event.filename in [':info', 'info']: for line in open(fpath).readlines(): diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgInfoXML.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgInfoXML.py index 92cf45824..956ebfe17 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgInfoXML.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgInfoXML.py @@ -9,7 +9,7 @@ class CfgInfoXML(CfgInfo): def __init__(self, path): CfgInfo.__init__(self, path) - self.infoxml = Bcfg2.Server.Plugin.InfoXML(path, noprio=True) + self.infoxml = Bcfg2.Server.Plugin.InfoXML(path) def bind_info_to_entry(self, entry, metadata): mdata = dict() diff --git a/src/lib/Bcfg2/Server/Plugins/SSLCA.py b/src/lib/Bcfg2/Server/Plugins/SSLCA.py index d207c45a2..9d1c51a08 100644 --- a/src/lib/Bcfg2/Server/Plugins/SSLCA.py +++ b/src/lib/Bcfg2/Server/Plugins/SSLCA.py @@ -77,8 +77,7 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool): self.CAs[ca] = dict(cp.items('sslca_' + ca)) self.Entries['Path'][ident] = self.get_cert elif event.filename.endswith("info.xml"): - self.infoxml[ident] = Bcfg2.Server.Plugin.InfoXML(epath, - noprio=True) + self.infoxml[ident] = Bcfg2.Server.Plugin.InfoXML(epath) self.infoxml[ident].HandleEvent(event) if action == 'deleted': if ident in self.Entries['Path']: -- cgit v1.2.3-1-g7c22