summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-ping-sweep
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-12-31 11:21:10 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-12-31 11:21:10 +0000
commitef5051726a3aa1f0192bd8d99c5c5b1ee9f067af (patch)
tree57bf0854d95c18cced379921657f746ad5faab04 /src/sbin/bcfg2-ping-sweep
parent104a1e27cee2d5524460d26c83d3e920cd88b2e9 (diff)
downloadbcfg2-ef5051726a3aa1f0192bd8d99c5c5b1ee9f067af.tar.gz
bcfg2-ef5051726a3aa1f0192bd8d99c5c5b1ee9f067af.tar.bz2
bcfg2-ef5051726a3aa1f0192bd8d99c5c5b1ee9f067af.zip
Switch over to more Options usage and complete tests (everything appears to work now)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4142 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-ping-sweep')
-rwxr-xr-xsrc/sbin/bcfg2-ping-sweep22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/sbin/bcfg2-ping-sweep b/src/sbin/bcfg2-ping-sweep
index 02e6d1f0e..ae4918d1f 100755
--- a/src/sbin/bcfg2-ping-sweep
+++ b/src/sbin/bcfg2-ping-sweep
@@ -5,24 +5,20 @@
__revision__ = '$Revision$'
from os import dup2, execl, fork, uname, wait
-import lxml.etree, sys, time, ConfigParser
-from Bcfg2.Settings import settings
+import lxml.etree, sys, time
+import Bcfg2.Options
if __name__ == '__main__':
+ opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY,
+ 'configfile': Bcfg2.Options.CFILE}
+ setup = Bcfg2.Options.OptionParser(opts)
+ setup.parse(sys.argv[1:])
-
- # override default settings
- if '-C' in sys.argv:
- settings.read_config_file(sys.argv[sys.argv.index('-C') + 1])
-
- clientdatapath = "%s/Metadata/clients.xml" % settings.SERVER_REPOSITORY
+ cfpath opts['configfile']
+ clientdatapath = "%s/Metadata/clients.xml" % opts['repo']
- try:
- clientElement = lxml.etree.parse(clientdatapath)
- except:
- print "Failed to parse '%s'" % clientdatapath
- raise SystemExit, 1
+ clientElement = lxml.etree.parse(clientdatapath)
hostlist = [client.get('name') for client in clientElement.findall("Client")]
pids = {}