diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-02-16 21:50:09 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-02-16 21:50:09 +0000 |
commit | 255b1518174eff2140cf6d915d7c38e967ccb604 (patch) | |
tree | 70afa01ae4719a29461dc4ff0f4c0d7b9736ba14 /src/lib/Server/Metadata.py | |
parent | 5553b1454aefdf7c833bf047f83c1b42ceb2a1d2 (diff) | |
download | bcfg2-255b1518174eff2140cf6d915d7c38e967ccb604.tar.gz bcfg2-255b1518174eff2140cf6d915d7c38e967ccb604.tar.bz2 bcfg2-255b1518174eff2140cf6d915d7c38e967ccb604.zip |
add logging
(Logical change 1.205)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@873 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Metadata.py')
-rw-r--r-- | src/lib/Server/Metadata.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/Server/Metadata.py b/src/lib/Server/Metadata.py index e1fc20828..23d502efe 100644 --- a/src/lib/Server/Metadata.py +++ b/src/lib/Server/Metadata.py @@ -77,9 +77,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: - # non-existent client + 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: @@ -87,13 +88,16 @@ class MetadataStore(SingleXMLFileBacked): clientdata[0].attrib['profile'] = profile clientdata[0].attrib['image'] = image self.WriteBack() - elif self.clients.has_key(client): - (image, profile) = self.clients[client] else: - # default profile stuff goes here - (image, profile) = (self.defaults['image'], self.defaults['profile']) - SubElement(self.element, "Client", name=client, profile=profile, image=image) - self.WriteBack() + # no asserted metadata + if self.clients.has_key(client): + (image, profile) = self.clients[client] + else: + # default profile stuff goes here + (image, profile) = (self.defaults['image'], self.defaults['profile']) + SubElement(self.element, "Client", name=client, profile=profile, image=image) + self.WriteBack() + if not self.profiles.has_key(profile): syslog(LOG_ERR, "Metadata: profile %s not defined" % profile) raise MetadataConsistencyError |