summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/Init.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-01-08 01:28:12 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-01-08 01:28:12 +0000
commitf2643329b73333da4037bd1f0e7186793c7195e6 (patch)
treed5501e7c91a65587c89dbec602a6722d23dab112 /src/lib/Server/Admin/Init.py
parent3ac7454263931f22b2700e078544c6056cc71509 (diff)
downloadbcfg2-f2643329b73333da4037bd1f0e7186793c7195e6.tar.gz
bcfg2-f2643329b73333da4037bd1f0e7186793c7195e6.tar.bz2
bcfg2-f2643329b73333da4037bd1f0e7186793c7195e6.zip
Admin fixups
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4196 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Admin/Init.py')
-rw-r--r--src/lib/Server/Admin/Init.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Server/Admin/Init.py b/src/lib/Server/Admin/Init.py
index 7a18c9287..7b934b22e 100644
--- a/src/lib/Server/Admin/Init.py
+++ b/src/lib/Server/Admin/Init.py
@@ -72,11 +72,12 @@ class Init(Bcfg2.Server.Admin.Mode):
'struct': Bcfg2.Options.SERVER_STRUCTURES,
'gens': Bcfg2.Options.SERVER_GENERATORS,
'proto': Bcfg2.Options.SERVER_PROTOCOL,
- 'sendmail': Bcfg2.Options.SENDMAIL_PATH}
+ 'sendmail': Bcfg2.Options.SENDMAIL_PATH,
+ 'configfile': Bcfg2.Options.CFILE}
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
- opts = Bcfg2.Options.OptionParser(options)
+ opts = Bcfg2.Options.OptionParser(self.options)
opts.parse([])
repopath = raw_input("location of bcfg2 repository [%s]: " % opts['repo'])
if repopath == '':
@@ -100,14 +101,14 @@ class Init(Bcfg2.Server.Admin.Mode):
def initializeRepo(self, repo, server_uri, password, os_selection, opts):
'''Setup a new repo'''
- keypath = os.path.dirname(os.path.abspath(settings.CONFIG_FILE))
+ keypath = os.path.dirname(os.path.abspath(opts['configfile']))
confdata = config % (
repo, opts['struct'], opts['gens'],
opts['sendmail'], opts['proto'],
password, keypath, server_uri
)
- open(settings.CONFIG_FILE,"w").write(confdata)
+ open(opts['configfile'], "w").write(confdata)
# FIXME automate ssl key generation
os.popen('openssl req -x509 -nodes -days 1000 -newkey rsa:1024 -out %s/bcfg2.key -keyout %s/bcfg2.key' % (keypath, keypath))
try: