summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-10-10 07:20:42 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-10-10 07:20:42 +0000
commitb1b6a1e1fe10bbd2fda6bebefdb10eaeef339967 (patch)
treec4cdf05227ae658974891ee5f9e6b91b621e9a8d /src/lib
parentc796436d3722d19a3af5528bda4849b8a81e4cf4 (diff)
downloadbcfg2-b1b6a1e1fe10bbd2fda6bebefdb10eaeef339967.tar.gz
bcfg2-b1b6a1e1fe10bbd2fda6bebefdb10eaeef339967.tar.bz2
bcfg2-b1b6a1e1fe10bbd2fda6bebefdb10eaeef339967.zip
Fix search_client for bcfg2-admin client mode
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4942 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Metadata.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index c19d1f9a4..f17f52ed4 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -151,8 +151,8 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
def search_client(self, client_name, tree):
'''find a client'''
- for node in tree:
- if node.attrib["name"] == client_name:
+ for node in tree.findall("//Client"):
+ if node.get("name") == client_name:
return node
for child in node:
if child.tag == "Alias" and child.attrib["name"] == client_name:
@@ -166,7 +166,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
element = lxml.etree.Element("Client", name=client_name)
for key, val in attribs.iteritems():
element.set(key, val)
- node = self.search_client(client_name, root)
+ node = self.search_client(client_name, tree)
if node != None:
self.logger.error("Client \"%s\" already exists" % (client_name))
raise MetadataConsistencyError
@@ -188,7 +188,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
'''Remove a client'''
tree = lxml.etree.parse(self.data + "/clients.xml")
root = tree.getroot()
- node = self.search_client(client_name, root)
+ node = self.search_client(client_name, tree)
if node == None:
self.logger.error("Client \"%s\" not found" % (client_name))
raise MetadataConsistencyError