From 12a14dcf1af90113ccd4212e62c770b1be97eb76 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 12 May 2005 17:56:24 +0000 Subject: do string conversion properly. 2005/05/12 12:48:46-05:00 anl.gov!desai make attributes actually work without scopes (Logical change 1.225) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@940 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Structures/Bundler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/Server/Structures') diff --git a/src/lib/Server/Structures/Bundler.py b/src/lib/Server/Structures/Bundler.py index acd2790ab..10914a61c 100644 --- a/src/lib/Server/Structures/Bundler.py +++ b/src/lib/Server/Structures/Bundler.py @@ -46,7 +46,7 @@ class Bundle(XMLFileBacked): xdata = XML(self.data) except ExpatError, err: syslog(LOG_ERR, "Failed to parse file %s" % (self.name)) - syslog(LOG_ERR, err) + syslog(LOG_ERR, str(err)) del self.data return self.all = [] @@ -56,7 +56,7 @@ class Bundle(XMLFileBacked): if entry.tag == 'System': self.systems[entry.attrib['name']] = entry.getchildren() elif entry.tag == 'Attribute': - self.attributes["%s.%s" % (entry.get('scope'), entry.get('name'))] = entry.getchildren() + self.attributes[entry.get('name')] = entry.getchildren() else: self.all.append(entry) del self.data @@ -67,7 +67,8 @@ class Bundle(XMLFileBacked): bundle = Element('Bundle', name=bundlename) for entry in self.all + self.systems.get(system, []): bundle.append(deepcopy(entry)) - for attribute in metadata.attributes: + for attribute in [aname for (scope, aname) in [item.split('.') for item in metadata.attributes] + if scope == bundlename[:-4]]: for entry in self.attributes.get(attribute, []): bundle.append(deepcopy(entry)) return bundle -- cgit v1.2.3-1-g7c22