summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-02-21 23:08:05 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-02-21 23:08:05 +0000
commit6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3 (patch)
treeb8adf4fde37c4926c94ff6bb5522d1c99431ccb6 /src/lib
parent056a24205300a8d7c410b7537c6c31bbf979d8d1 (diff)
downloadbcfg2-6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3.tar.gz
bcfg2-6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3.tar.bz2
bcfg2-6fc4c7e8366cbf0150a3e9715d2ee80f09d439a3.zip
fix assertion in case of preexisting entry
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1762 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Metadata.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/Server/Metadata.py b/src/lib/Server/Metadata.py
index 36c8e0e59..b4a5afd2a 100644
--- a/src/lib/Server/Metadata.py
+++ b/src/lib/Server/Metadata.py
@@ -110,21 +110,21 @@ class Metadata:
self.logger.error("Removing client mapping for %s" % (client))
del self.clients[client]
- def set_group(self, client, group):
+ def set_profile(self, client, profile):
'''Set group parameter for provided client'''
- self.logger.info("Asserting client %s profile to %s" % (client, group))
+ self.logger.info("Asserting client %s profile to %s" % (client, profile))
if False in self.states.values():
raise MetadataRuntimeError
- if group not in self.public:
- self.logger.error("Failed to set client %s to private group %s" % (client, group))
+ if profile not in self.public:
+ self.logger.error("Failed to set client %s to private group %s" % (client, profile))
raise MetadataConsistencyError
if self.clients.has_key(client):
- self.logger.info("Changing %s group from %s to %s" % (client, self.clients[client], group))
+ self.logger.info("Changing %s group from %s to %s" % (client, self.clients[client], profile))
cli = self.clientdata.xpath('/Clients/Client[@name="%s"]' % (client))
- cli[0].set('group', group)
+ cli[0].set('profile', profile)
else:
- lxml.etree.SubElement(self.clientdata.getroot(), 'Client', name=client, profile=group)
- self.clients[client] = group
+ lxml.etree.SubElement(self.clientdata.getroot(), 'Client', name=client, profile=profile)
+ self.clients[client] = profile
self.write_back_clients()
def write_back_clients(self):