summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-info
diff options
context:
space:
mode:
authorRobert Gogolok <gogo@cs.uni-sb.de>2007-12-30 19:26:51 +0000
committerRobert Gogolok <gogo@cs.uni-sb.de>2007-12-30 19:26:51 +0000
commite8c9ba57d10d174c79ac1aae9b53661ee8464d0f (patch)
tree65cb5f7b0c699e6c97eb365ec83c76155a023f7e /src/sbin/bcfg2-info
parent73ba22f7e519694dbf7010810de69b3b845f634f (diff)
downloadbcfg2-e8c9ba57d10d174c79ac1aae9b53661ee8464d0f.tar.gz
bcfg2-e8c9ba57d10d174c79ac1aae9b53661ee8464d0f.tar.bz2
bcfg2-e8c9ba57d10d174c79ac1aae9b53661ee8464d0f.zip
Settings class to remove redundant code for parsing config file.
If a module wants to access bcfg2 settings: from Bcfg2.Settings import settings git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4131 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-info')
-rwxr-xr-xsrc/sbin/bcfg2-info10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index f40ef3e60..6693efea2 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -6,6 +6,7 @@ import copy, logging, lxml.etree, sys, time, cmd
import Bcfg2.Logging, Bcfg2.Server.Core, os
import Bcfg2.Server.Plugins.Metadata, Bcfg2.Server.Plugin
import Bcfg2.Options
+from Bcfg2.Settings import settings
logger = logging.getLogger('bcfg2-info')
@@ -23,10 +24,10 @@ def printTabular(rows):
print fstring % row
class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core):
- def __init__(self, cfpath):
+ def __init__(self):
cmd.Cmd.__init__(self)
try:
- Bcfg2.Server.Core.Core.__init__(self, {}, cfpath)
+ Bcfg2.Server.Core.Core.__init__(self)
except Bcfg2.Server.Core.CoreInitError, msg:
print "Core load failed because %s" % msg
raise SystemExit(1)
@@ -270,6 +271,9 @@ if __name__ == '__main__':
optparser = Bcfg2.Options.OptionParser('bcfg2-info', optinfo)
setup = optparser.parse()
- loop = infoCore(setup['configfile'])
+ # override default settings
+ settings.read_config_file(setup['configfile'])
+
+ loop = infoCore()
loop.plugins['Metadata'].load_probedata()
loop.do_loop()