From fda7aa236eed82bae5f4a8b424966c80c75d7182 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 2 Feb 2009 21:52:46 +0000 Subject: Add client aliases to metadata instances git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5059 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Metadata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py index f63e2d558..f6803b5ba 100644 --- a/src/lib/Server/Plugins/Metadata.py +++ b/src/lib/Server/Plugins/Metadata.py @@ -15,7 +15,7 @@ class MetadataRuntimeError(Exception): class ClientMetadata(object): '''This object contains client metadata''' def __init__(self, client, profile, groups, bundles, categories, uuid, - password, overall): + password, overall, aliases): self.hostname = client self.profile = profile self.bundles = bundles @@ -23,6 +23,7 @@ class ClientMetadata(object): self.categories = categories self.uuid = uuid self.password = password + self.aliases = aliases self.all = overall self.connectors = [] @@ -372,6 +373,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, newbundles = bundles[:] newcategories = {} newcategories.update(categories) + aliases = [key for key, value in self.aliases.iteritems() if value == client] if client in self.passwords: password = self.passwords[client] else: @@ -393,7 +395,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, clientscopy = copy.deepcopy(self.clients) return ClientMetadata(client, profile, newgroups, newbundles, newcategories, uuid, password, - (groupscopy, clientscopy)) + (groupscopy, clientscopy), aliases) def merge_additional_groups(self, imd, groups): for group in groups: -- cgit v1.2.3-1-g7c22