summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-12-06 19:13:07 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-12-06 19:13:07 +0000
commitd3fb8f59ae8659c4d1d7f2a65d3a8322c8439829 (patch)
tree8f14a1b20ffada83bb051213f324417c2b8198dc
parent592d406208fb387fc14b5ec2663804d9f6a22a49 (diff)
downloadbcfg2-d3fb8f59ae8659c4d1d7f2a65d3a8322c8439829.tar.gz
bcfg2-d3fb8f59ae8659c4d1d7f2a65d3a8322c8439829.tar.bz2
bcfg2-d3fb8f59ae8659c4d1d7f2a65d3a8322c8439829.zip
fix client metadata assertion problem
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1613 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Metadata.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lib/Server/Metadata.py b/src/lib/Server/Metadata.py
index e83715fbe..957179751 100644
--- a/src/lib/Server/Metadata.py
+++ b/src/lib/Server/Metadata.py
@@ -78,17 +78,10 @@ class MetadataStore(SingleXMLFileBacked):
if ((image != None) and (profile != None)):
# Client asserted profile/image
self.clients[client] = (image, profile)
- syslog(LOG_INFO, "Asserted metadata for %s: %s, %s" % (client, image, profile))
- clientdata = [cli for cli in self.element.findall("Client") if cli.get('name') == client]
- if len(clientdata) == 0:
- syslog(LOG_INFO, "Added Metadata for nonexistent client %s" % client)
- SubElement(self.element, "Client", name=client, image=image, profile=profile)
- self.WriteBack()
- elif len(clientdata) == 1:
- # already existing client
- clientdata[0].attrib['profile'] = profile
- clientdata[0].attrib['image'] = image
- self.WriteBack()
+ syslog(LOG_INFO, "Metadata: Asserted metadata for %s: %s, %s" % (client, image, profile))
+ [self.element.remove(cli) for cli in self.element.findall("Client") if cli.get('name') == client]
+ SubElement(self.element, "Client", name=client, image=image, profile=profile)
+ self.WriteBack()
else:
# no asserted metadata
if self.clients.has_key(client):