summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-ping-sweep
diff options
context:
space:
mode:
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 = {}