summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-info14
-rwxr-xr-xsrc/sbin/bcfg2-server11
2 files changed, 19 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index bde7ef868..296027034 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -23,10 +23,10 @@ def printTabular(rows):
print fstring % row
class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core):
- def __init__(self):
+ def __init__(self, repo, struct, gens, passwd, svn):
cmd.Cmd.__init__(self)
try:
- Bcfg2.Server.Core.Core.__init__(self)
+ Bcfg2.Server.Core.Core.__init__(self, repo, struct, gens, passwd, svn)
except Bcfg2.Server.Core.CoreInitError, msg:
print "Core load failed because %s" % msg
raise SystemExit(1)
@@ -260,14 +260,20 @@ Usage: [quit|exit]"""
if __name__ == '__main__':
Bcfg2.Logging.setup_logging('bcfg2-info', to_syslog=False)
-
+ print dir(Bcfg2.Options)
optinfo = {
'configfile': Bcfg2.Options.CFILE,
'help': Bcfg2.Options.HELP,
}
+ optinfo.update({'repo': Bcfg2.Options.SERVER_REPOSITORY,
+ 'svn': Bcfg2.Options.SERVER_SVN,
+ 'structures': Bcfg2.Options.SERVER_STRUCTURES,
+ 'generators': Bcfg2.Options.SERVER_GENERATORS,
+ 'password': Bcfg2.Options.SERVER_PASSWORD})
setup = Bcfg2.Options.OptionParser(optinfo)
setup.parse(sys.argv[1:])
- loop = infoCore()
+ loop = infoCore(setup['repo'], setup['structures'], setup['generators'],
+ setup['password'], setup['svn'])
loop.plugins['Metadata'].load_probedata()
loop.do_loop()
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index ecb5b357d..489a5766d 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -20,7 +20,7 @@ def critical_error(operation):
raise Fault, (7, "Critical unexpected failure: %s" % (operation))
class SetupError(Exception):
- '''Used when the server can't be setup'''
+ '''Used when the server cant be setup'''
pass
class Bcfg2Serv(Bcfg2.Component.Component):
@@ -39,7 +39,8 @@ class Bcfg2Serv(Bcfg2.Component.Component):
raise SetupError
try:
- self.Core = Core()
+ self.Core = Core(setup['repo'], setup['structures'],
+ setup['generators'], setup['password'], setup['svn'])
except CoreInitError, msg:
logger.critical("Fatal error: %s" % (msg))
raise SystemExit, 1
@@ -185,6 +186,12 @@ if __name__ == '__main__':
'verbose' : Bcfg2.Options.VERBOSE,
}
+ OPTINFO.update({'repo': Bcfg2.Options.SERVER_REPOSITORY,
+ 'svn': Bcfg2.Options.SERVER_SVN,
+ 'structures': Bcfg2.Options.SERVER_STRUCTURES,
+ 'generators': Bcfg2.Options.SERVER_GENERATORS,
+ 'password': Bcfg2.Options.SERVER_PASSWORD})
+
setup = Bcfg2.Options.OptionParser(OPTINFO)
setup.parse(sys.argv[1:])
print setup