summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-05-12 17:56:24 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-05-12 17:56:24 +0000
commit12a14dcf1af90113ccd4212e62c770b1be97eb76 (patch)
tree8f584d8c6792a3ed137c456c34c79f13e37ef13e /src
parent6daebe4f805e2c071a90c1c7fb86156f8dc5b10a (diff)
downloadbcfg2-12a14dcf1af90113ccd4212e62c770b1be97eb76.tar.gz
bcfg2-12a14dcf1af90113ccd4212e62c770b1be97eb76.tar.bz2
bcfg2-12a14dcf1af90113ccd4212e62c770b1be97eb76.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Structures/Bundler.py7
1 files changed, 4 insertions, 3 deletions
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