From f2643329b73333da4037bd1f0e7186793c7195e6 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 8 Jan 2008 01:28:12 +0000 Subject: Admin fixups git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4196 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Init.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/lib/Server/Admin/Init.py') 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: -- cgit v1.2.3-1-g7c22