summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-05-18 13:55:58 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-05-18 13:55:58 +0000
commitfe540ca94fbc7c4b3171fa27cead193230e4a201 (patch)
treedf619f0349034bc2b3a69aec7f50624cb276a08b
parent68cf256be3696164247ba22c8681890cd43e47cc (diff)
downloadbcfg2-fe540ca94fbc7c4b3171fa27cead193230e4a201.tar.gz
bcfg2-fe540ca94fbc7c4b3171fa27cead193230e4a201.tar.bz2
bcfg2-fe540ca94fbc7c4b3171fa27cead193230e4a201.zip
Add support for probed groups in bcfg2-admin query (Resolves Ticket #647)
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5242 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Admin/Query.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/Server/Admin/Query.py b/src/lib/Server/Admin/Query.py
index 4d77b1563..2e2ab4dc5 100644
--- a/src/lib/Server/Admin/Query.py
+++ b/src/lib/Server/Admin/Query.py
@@ -23,7 +23,7 @@ class Query(Bcfg2.Server.Admin.Mode):
Bcfg2.Server.Admin.Mode.__init__(self, cfile)
try:
self.bcore = Bcfg2.Server.Core.Core(self.get_repo_path(),
- ['Metadata'],
+ ['Metadata', 'Probes'],
'foo', False, 'UTF-8')
except Bcfg2.Server.Core.CoreInitError, msg:
self.errExit("Core load failed because %s" % msg)
@@ -54,6 +54,13 @@ class Query(Bcfg2.Server.Admin.Mode):
nc = self.meta.GetClientByProfile(v)
elif k == 'g':
nc = self.meta.GetClientByGroup(v)
+ # add probed groups (if present)
+ for conn in self.bcore.connectors:
+ if isinstance(conn, Bcfg2.Server.Plugins.Probes.Probes):
+ for c, glist in conn.cgroups.items():
+ for g in glist:
+ if g == v:
+ nc.append(c)
else:
print "One of g= or p= must be specified"
raise SystemExit(1)