diff options
author | Robert Gogolok <gogo@cs.uni-sb.de> | 2007-12-30 19:26:51 +0000 |
---|---|---|
committer | Robert Gogolok <gogo@cs.uni-sb.de> | 2007-12-30 19:26:51 +0000 |
commit | e8c9ba57d10d174c79ac1aae9b53661ee8464d0f (patch) | |
tree | 65cb5f7b0c699e6c97eb365ec83c76155a023f7e /src/sbin/bcfg2-server | |
parent | 73ba22f7e519694dbf7010810de69b3b845f634f (diff) | |
download | bcfg2-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-server')
-rwxr-xr-x | src/sbin/bcfg2-server | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index e6a00efbc..554a5ae24 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -5,6 +5,7 @@ __revision__ = '$Revision$' import Bcfg2.Server.Plugins.Metadata +from Bcfg2.Settings import settings from Bcfg2.Server.Core import Core, CoreInitError from xmlrpclib import Fault from lxml.etree import XML, Element, tostring @@ -39,7 +40,7 @@ class Bcfg2Serv(Bcfg2.Component.Component): raise SetupError try: - self.Core = Core(setup, setup['configfile']) + self.Core = Core() except CoreInitError, msg: logger.critical("Fatal error: %s" % (msg)) raise SystemExit, 1 @@ -184,7 +185,7 @@ if __name__ == '__main__': 'daemon': (('-D', '<pidfile>', 'daemonize the server, storing PID'), False, False, False, False), 'configfile': (('-C', '<conffile>', 'use this config file'), - False, False, '/etc/bcfg2.conf', False), + False, False, False, False), } SSETUP = Bcfg2.Options.OptionParser('bcfg2', OPTINFO).parse() @@ -195,6 +196,10 @@ if __name__ == '__main__': Bcfg2.Logging.setup_logging('bcfg2-server', level=level) if SSETUP['daemon']: Bcfg2.Daemon.daemonize(SSETUP['daemon']) + + # override default settings + settings.read_config_file(SSETUP['configfile']) + try: BSERV = Bcfg2Serv(SSETUP) except SetupError: |