From 01e56e153fd83c0b51760cf4ec04cc07e39bcc1b Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Fri, 12 Sep 2008 21:25:16 +0000 Subject: Improve help messages for bcfg2-admin (and modes) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4910 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Init.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 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 c97d82133..941ef1596 100644 --- a/src/lib/Server/Admin/Init.py +++ b/src/lib/Server/Admin/Init.py @@ -70,8 +70,10 @@ os_list = [ class Init(Bcfg2.Server.Admin.Mode): - __shorthelp__ = 'bcfg2-admin init' - __longhelp__ = __shorthelp__ + '\n\tCompare two client specifications or directories of specifications' # FIXME + __shorthelp__ = ("Compare two client specifications or " + "directories of specifications") # FIXME + __longhelp__ = __shorthelp__ + "\n\nbcfg2-admin init" + __usage__ = "bcfg2-admin init" options = { 'configfile': Bcfg2.Options.CFILE, 'gens' : Bcfg2.Options.SERVER_GENERATORS, @@ -87,11 +89,13 @@ class Init(Bcfg2.Server.Admin.Mode): opts.parse([]) # FIXME don't overwrite existing bcfg2.conf file - configfile = raw_input("Store bcfg2 configuration in [%s]: " % opts['configfile']) + configfile = raw_input("Store bcfg2 configuration in [%s]: " % + opts['configfile']) if configfile == '': configfile = opts['configfile'] - repopath = raw_input("Location of bcfg2 repository [%s]: " % opts['repo']) + repopath = raw_input("Location of bcfg2 repository [%s]: " % + opts['repo']) if repopath == '': repopath = opts['repo'] @@ -112,7 +116,8 @@ class Init(Bcfg2.Server.Admin.Mode): prompt += "%d: %s\n" % (os_list.index(entry) + 1, entry[0]) prompt += ': ' os_sel = os_list[int(raw_input(prompt))-1][1] - self.initializeRepo(configfile, repopath, server, password, os_sel, opts) + self.initializeRepo(configfile, repopath, server, + password, os_sel, opts) print "Repository created successfuly in %s" % (repopath) def genPassword(self): @@ -138,11 +143,11 @@ class Init(Bcfg2.Server.Admin.Mode): except: # FIXME how to handle print "Failed to write configuration file to '%s'\n" % configfile - pass # FIXME automate ssl key generation # FIXME key generation may fail as non-root user - os.popen('openssl req -x509 -nodes -days 1000 -newkey rsa:1024 -out %s/bcfg2.key -keyout %s/bcfg2.key' % (keypath, keypath)) + os.popen('openssl req -x509 -nodes -days 1000 -newkey rsa:1024 -out' \ + '%s/bcfg2.key -keyout %s/bcfg2.key' % (keypath, keypath)) try: os.chmod('%s/bcfg2.key'% keypath, 0600) except: @@ -161,5 +166,7 @@ class Init(Bcfg2.Server.Admin.Mode): except: continue - open("%s/Metadata/groups.xml" % repo, "w").write(groups % os_selection) - open("%s/Metadata/clients.xml" % repo, "w").write(clients % socket.getfqdn()) + open("%s/Metadata/groups.xml" % + repo, "w").write(groups % os_selection) + open("%s/Metadata/clients.xml" % + repo, "w").write(clients % socket.getfqdn()) -- cgit v1.2.3-1-g7c22