summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-02-02 21:52:46 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-02-02 21:52:46 +0000
commitfda7aa236eed82bae5f4a8b424966c80c75d7182 (patch)
treecbe99c9f16b50a725236b77d9b96f1b444eb6c7b /src
parentcf9b9d397472cfbbdbf0db47975fc67020860c28 (diff)
downloadbcfg2-fda7aa236eed82bae5f4a8b424966c80c75d7182.tar.gz
bcfg2-fda7aa236eed82bae5f4a8b424966c80c75d7182.tar.bz2
bcfg2-fda7aa236eed82bae5f4a8b424966c80c75d7182.zip
Add client aliases to metadata instances
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5059 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Metadata.py6
1 files 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: