From d922822bbe23387577e9e8c9f60131ac00a24c9f Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sat, 10 Jan 2009 15:17:59 +0000 Subject: Rework bcfg2-info/showclient to use new metadata interface git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5006 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Metadata.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py index 355624ccc..eacc53f4b 100644 --- a/src/lib/Server/Plugins/Metadata.py +++ b/src/lib/Server/Plugins/Metadata.py @@ -14,9 +14,10 @@ class MetadataRuntimeError(Exception): class ClientMetadata(object): '''This object contains client metadata''' - def __init__(self, client, groups, bundles, categories, uuid, + def __init__(self, client, profile, groups, bundles, categories, uuid, password, overall): self.hostname = client + self.profile = profile self.bundles = bundles self.groups = groups self.categories = categories @@ -358,7 +359,8 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, if client in self.aliases: client = self.aliases[client] if client in self.clients: - (bundles, groups, categories) = self.groups[self.clients[client]] + profile = self.clients[client] + (bundles, groups, categories) = self.groups[profile] else: if self.default == None: self.logger.error("Cannot set group for client %s; no default group set" % (client)) @@ -388,8 +390,9 @@ class Metadata(Bcfg2.Server.Plugin.Plugin, newcategories.update(ncategories) groupscopy = copy.deepcopy(self.groups) clientscopy = copy.deepcopy(self.clients) - return ClientMetadata(client, newgroups, newbundles, newcategories, - uuid, password, (groupscopy, clientscopy)) + return ClientMetadata(client, profile, newgroups, newbundles, + newcategories, uuid, password, + (groupscopy, clientscopy)) def merge_additional_metadata(self, imd, source, groups, data): for group in groups: -- cgit v1.2.3-1-g7c22