From 90b1276b8039642f95f5987ff1d0df413454a6d9 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 17 Oct 2012 10:26:13 -0400 Subject: expanded pylint coverage to Admin modes, removed some old/broken admin modes --- src/sbin/bcfg2-info | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/sbin/bcfg2-info') diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index 16e1e8ca1..d6d529dec 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -687,6 +687,25 @@ Bcfg2 client itself.""") collection = self.plugins['Packages'].get_collection(metadata) print(collection.sourcelist()) + def do_query(self, args): + """ query {-g group|-p profile|-b bundle} - Query clients """ + arglist = args.split(" ") + if len(arglist) != 2: + print(self._get_usage(self.do_query)) + return + + qtype, qparam = arglist + if qtype == '-p': + res = self.metadata.get_client_names_by_profiles(qparam.split(',')) + elif qtype == '-g': + res = self.metadata.get_client_names_by_groups(qparam.split(',')) + elif qtype == '-b': + res = self.metadata.get_client_names_by_bundles(qparam.split(',')) + else: + print(self._get_usage(self.do_query)) + return + print("\n".join(res)) + def do_profile(self, arg): """ profile - Profile a single bcfg2-info command """ -- cgit v1.2.3-1-g7c22