summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-ping-sweep
diff options
context:
space:
mode:
authorRobert Gogolok <gogo@cs.uni-sb.de>2007-12-30 20:14:43 +0000
committerRobert Gogolok <gogo@cs.uni-sb.de>2007-12-30 20:14:43 +0000
commit6b3e207ff05877821779d09e01861eabc05c0c49 (patch)
tree33940ae10b72e3b32869e3f281551d34e8c6b1af /src/sbin/bcfg2-ping-sweep
parent06eeffe8e6344ac62b74cae38d2733b4b64900f1 (diff)
downloadbcfg2-6b3e207ff05877821779d09e01861eabc05c0c49.tar.gz
bcfg2-6b3e207ff05877821779d09e01861eabc05c0c49.tar.bz2
bcfg2-6b3e207ff05877821779d09e01861eabc05c0c49.zip
bcfg2-ping-sweep:
- use Bcfg2.Settings - don't crash if clients.xml can't be parsed git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4134 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-ping-sweep')
-rwxr-xr-xsrc/sbin/bcfg2-ping-sweep19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/sbin/bcfg2-ping-sweep b/src/sbin/bcfg2-ping-sweep
index 83abc25f2..02e6d1f0e 100755
--- a/src/sbin/bcfg2-ping-sweep
+++ b/src/sbin/bcfg2-ping-sweep
@@ -6,18 +6,23 @@ __revision__ = '$Revision$'
from os import dup2, execl, fork, uname, wait
import lxml.etree, sys, time, ConfigParser
+from Bcfg2.Settings import settings
+
if __name__ == '__main__':
+
+
+ # override default settings
if '-C' in sys.argv:
- cfpath = sys.argv[sys.argv.index('-C') + 1]
- else:
- cfpath = '/etc/bcfg2.conf'
+ settings.read_config_file(sys.argv[sys.argv.index('-C') + 1])
- c = ConfigParser.ConfigParser()
- c.read([cfpath])
- clientdatapath = "%s/Metadata/clients.xml" % c.get('server', 'repository')
+ clientdatapath = "%s/Metadata/clients.xml" % settings.SERVER_REPOSITORY
- clientElement = lxml.etree.parse(clientdatapath)
+ try:
+ clientElement = lxml.etree.parse(clientdatapath)
+ except:
+ print "Failed to parse '%s'" % clientdatapath
+ raise SystemExit, 1
hostlist = [client.get('name') for client in clientElement.findall("Client")]
pids = {}