From a665fb536a46d9f9b9e775d3797d8c5c79939982 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 11 Nov 2004 15:49:05 +0000 Subject: fix XMLFileBacked 2004/11/10 15:00:06-06:00 anl.gov!desai fix ScopedXMLFiles problem caused by pylint fixups 2004/11/10 13:35:37-06:00 anl.gov!desai add fam into the mix (Logical change 1.151) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@676 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Generator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Generator.py b/src/lib/Server/Generator.py index 88a0b02d7..0089df111 100644 --- a/src/lib/Server/Generator.py +++ b/src/lib/Server/Generator.py @@ -132,10 +132,10 @@ class XMLFileBacked(FileBacked): '''This object is a coherent cache for an XML file to be used as a part of DirectoryBacked.''' __identifier__ = 'name' - def __init__(self, filename, fam): - FileBacked.__init__(self, filename, fam) + def __init__(self, filename): self.label = "dummy" self.entries = [] + FileBacked.__init__(self, filename) def Index(self): '''Build local data structures''' @@ -161,9 +161,9 @@ class ScopedXMLFile(SingleXMLFileBacked): __containers__ = ['Class', 'Host', 'Image'] def __init__(self, filename, fam): - SingleXMLFileBacked.__init__(self, filename, fam) self.store = {} self.__provides__ = {} + SingleXMLFileBacked.__init__(self, filename, fam) def StoreRecord(self, metadata, entry): '''Store scoped record based on metadata''' @@ -189,7 +189,8 @@ class ScopedXMLFile(SingleXMLFileBacked): name = (entry.tag, entry.get('name')) [self.StoreRecord(name, child) for child in entry.getchildren()] # now to build the __provides__ table - self.__provides__ = {} + for key in self.__provides__.keys(): + del self.__provides__[key] for key in self.store.keys(): self.__provides__[key] = {} for name in self.store[key].keys(): -- cgit v1.2.3-1-g7c22