diff options
-rw-r--r-- | src/lib/Server/Admin/Client.py | 3 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Metadata.py | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Server/Admin/Client.py b/src/lib/Server/Admin/Client.py index c4f931350..618e5b826 100644 --- a/src/lib/Server/Admin/Client.py +++ b/src/lib/Server/Admin/Client.py @@ -72,4 +72,7 @@ class Client(Bcfg2.Server.Admin.Mode): for node in self.root: if node.attrib["name"] == client: return node + for child in node: + if child.tag == "Alias" and child.attrib["name"] == client: + return node return None diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py index 9f8b641cc..a5084e0d3 100644 --- a/src/lib/Server/Plugins/Metadata.py +++ b/src/lib/Server/Plugins/Metadata.py @@ -246,7 +246,12 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin, 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): + # resolve aliases + for node in self.clients: + for child in node: + if child.tag == "Alias" and child.attrib["name"] == client: + client = node.attrib["name"] + if self.clients.has_key(client): 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('profile', profile) |