diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-05-01 17:44:20 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-05-01 17:44:20 +0000 |
commit | 0b1e814f89afb560c5d1b3af7ddb2cd2f5f2ab88 (patch) | |
tree | 52be3167255e588068d345d0bd4fda8cdeb6e9df /src/sbin | |
parent | 220dea241c2ceac979ad7e668e20bf8fb4e2d22a (diff) | |
download | bcfg2-0b1e814f89afb560c5d1b3af7ddb2cd2f5f2ab88.tar.gz bcfg2-0b1e814f89afb560c5d1b3af7ddb2cd2f5f2ab88.tar.bz2 bcfg2-0b1e814f89afb560c5d1b3af7ddb2cd2f5f2ab88.zip |
Replace bcfg2-query with bcfg2-admin query
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4582 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-query | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/sbin/bcfg2-query b/src/sbin/bcfg2-query deleted file mode 100755 index 61fd37aee..000000000 --- a/src/sbin/bcfg2-query +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python - -import Bcfg2.Server.Core, Bcfg2.Logging -import lxml.etree, sys, ConfigParser, time - -if __name__ == "__main__": - CP = ConfigParser.ConfigParser() - CP.read(['/etc/bcfg2.conf']) - try: - prefix = CP.get('server', 'repository') - except: - prefix = "/var/lib/bcfg2" - - if len(sys.argv) < 2: - print "Usage bcfg2-query -a|-c|-s|-n|-g <group name> -p <profile name>" - print "\t -a\t\t shows all clients" - print "\t -c\t\t prints node names in a comma delimited list" - print "\t -s\t\t prints node names in a space delimited list" - print "\t -n\t\t prints node names in a newline delimited list (default)" - print "\t -v\t\t turn on debugging messages" - print "\t -g <group name>\t shows all the clients that are members of that group" - print "\t -p <profile name>\t shows all the clients of that profile" - sys.exit(1) - - ''' Create the metadata object ''' - bcore = Bcfg2.Server.Core.Core('%s'%prefix, [], ['Metadata'], None, False) - while(bcore.fam.Service()): - time.sleep(1) - mdata = bcore.plugins['Metadata'] - - ''' Turn on debugging ''' - if '-v' in sys.argv: - Bcfg2.Logging.setup_logging(0, to_console=True) - - if '-a' in sys.argv: - cnames = [key for key in mdata.clients.keys()] - elif '-g' in sys.argv: - group = sys.argv[sys.argv.index('-g') + 1] - cnames = mdata.GetClientByGroup('%s' % group) - elif '-p' in sys.argv: - profile = sys.argv[sys.argv.index('-p') + 1] - cnames = mdata.GetClientByProfile('%s' % profile) - - if '-c' in sys.argv: - print ",".join(cnames) - elif '-s' in sys.argv: - print " ".join(cnames) - else: - print "\n".join(cnames) |