summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-12-28 16:27:38 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-12-28 16:27:38 +0000
commit6501531fd4c2d866613d66532e5bd5a209659b98 (patch)
tree261444d99f949468b24d5ec3f43e0ca1b7835eae /src
parentf19ee18ffbf37166bbb28ce2f6a8e0b6fbc517a5 (diff)
downloadbcfg2-6501531fd4c2d866613d66532e5bd5a209659b98.tar.gz
bcfg2-6501531fd4c2d866613d66532e5bd5a209659b98.tar.bz2
bcfg2-6501531fd4c2d866613d66532e5bd5a209659b98.zip
Add Metadata.GetClientByGroup that returns a list of clients by group membership
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4118 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Metadata.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index ee4f0ec0e..ae23ece0f 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -23,7 +23,7 @@ class ClientMetadata(object):
self.probes = probed
self.uuid = uuid
self.password = password
- self.overall = overall
+ self.all = overall
def inGroup(self, group):
'''Test to see if client is a member of group'''
@@ -439,3 +439,8 @@ class Metadata(Bcfg2.Server.Plugin.Plugin):
if user != 'root':
self.session_cache[address] = (time.time(), user)
return True
+
+ def GetClientByGroup(self, group):
+ '''Return a list of clients that are in a given group'''
+ return [client for client in self.clients \
+ if group in self.groups[self.clients[client]][1]]