summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gogolok <gogo@cs.uni-sb.de>2007-12-31 11:50:15 +0000
committerRobert Gogolok <gogo@cs.uni-sb.de>2007-12-31 11:50:15 +0000
commit0f7d5f15086454c45d05afab9a54448dfa440df2 (patch)
tree6ed601ae4b2ad6d152542642b92ad90acf3d6c43
parentde51ebac57f438b15dd7f05403ff4b38c7c79b8c (diff)
downloadbcfg2-0f7d5f15086454c45d05afab9a54448dfa440df2.tar.gz
bcfg2-0f7d5f15086454c45d05afab9a54448dfa440df2.tar.bz2
bcfg2-0f7d5f15086454c45d05afab9a54448dfa440df2.zip
bcfg2-server: cleanup code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4144 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-xsrc/sbin/bcfg2-server18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index d2fdfa6ab..393cae471 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -175,23 +175,25 @@ class Bcfg2Serv(Bcfg2.Component.Component):
if __name__ == '__main__':
OPTINFO = {
- 'verbose': Bcfg2.Options.VERBOSE,
- 'debug': Bcfg2.Options.DEBUG,
- 'help': Bcfg2.Options.HELP,
- 'daemon': Bcfg2.Options.DAEMON,
'configfile': Bcfg2.Options.CFILE,
+ 'daemon' : Bcfg2.Options.DAEMON,
+ 'debug' : Bcfg2.Options.DEBUG,
+ 'help' : Bcfg2.Options.HELP,
+ 'verbose' : Bcfg2.Options.VERBOSE,
}
-
+
setup = Bcfg2.Options.OptionParser(OPTINFO)
setup.parse(sys.argv[1:])
print setup
+
+
level = 0
- if '-D' in sys.argv:
+ if setup['daemon']:
Bcfg2.Logging.setup_logging('bcfg2-server', to_console=False, level=level)
+ Bcfg2.Daemon.daemonize(setup['daemon'])
else:
Bcfg2.Logging.setup_logging('bcfg2-server', level=level)
- if setup['daemon']:
- Bcfg2.Daemon.daemonize(setup['daemon'])
+
try:
BSERV = Bcfg2Serv(setup)