diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2011-01-06 14:27:46 -0600 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2011-01-06 14:27:46 -0600 |
commit | f384258af81136eacc85cf4adb01db34667600ab (patch) | |
tree | f73b4f28fd369d116ffcc52077f494ec426742d4 /src/lib | |
parent | bd5aebba93fbd67b61d1a6f3ec221bc7e94f1559 (diff) | |
parent | f2f34ec086678222708535df74d9ee929f65a78a (diff) | |
download | bcfg2-f384258af81136eacc85cf4adb01db34667600ab.tar.gz bcfg2-f384258af81136eacc85cf4adb01db34667600ab.tar.bz2 bcfg2-f384258af81136eacc85cf4adb01db34667600ab.zip |
Merge branch 'master' of git.mcs.anl.gov:bcfg2
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Options.py | 50 | ||||
-rw-r--r-- | src/lib/Server/Admin/Backup.py | 4 | ||||
-rw-r--r-- | src/lib/Server/Admin/Bundle.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Admin/Client.py | 10 | ||||
-rw-r--r-- | src/lib/Server/Admin/Group.py | 10 | ||||
-rw-r--r-- | src/lib/Server/Admin/Init.py | 110 | ||||
-rw-r--r-- | src/lib/Server/Admin/Minestruct.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Admin/Perf.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Admin/Pull.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Admin/Snapshots.py | 15 | ||||
-rw-r--r-- | src/lib/Server/Admin/Tidy.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Admin/Viz.py | 3 | ||||
-rw-r--r-- | src/lib/Server/Admin/Xcmd.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Admin/__init__.py | 2 |
14 files changed, 146 insertions, 78 deletions
diff --git a/src/lib/Options.py b/src/lib/Options.py index 1dcad6427..4041ccf78 100644 --- a/src/lib/Options.py +++ b/src/lib/Options.py @@ -93,7 +93,7 @@ class Option(object): def parse(self, opts, rawopts): if self.cmd and opts: - # processing getopted data + # Processing getopted data optinfo = [opt[1] for opt in opts if opt[0] == self.cmd] if optinfo: if optinfo[0]: @@ -105,7 +105,7 @@ class Option(object): data = rawopts[rawopts.index(self.cmd) + 1] self.value = self.get_cooked_value(data) return - # no command line option found + # No command line option found if self.env and self.env in os.environ: self.value = self.get_cooked_value(os.environ[self.env]) return @@ -115,7 +115,7 @@ class Option(object): return except: pass - # default value not cooked + # Default value not cooked self.value = self.default class OptionSet(dict): @@ -141,7 +141,7 @@ class OptionSet(dict): raise SystemExit(code) def parse(self, argv, do_getopt=True): - '''Parse options''' + '''Parse options from command line.''' if do_getopt: try: opts, args = getopt.getopt(argv, self.buildGetopt(), @@ -171,7 +171,7 @@ def colon_split(c_string): return c_string.split(':') return [] -#General options +# General options CFILE = Option('Specify configuration file', DEFAULT_CONFIG_LOCATION, cmd='-C', odesc='<conffile>') LOCKFILE = Option('Specify lockfile', @@ -187,7 +187,7 @@ INSTALL_PREFIX = Option('Installation location', cf=('server', 'prefix'), default=DEFAULT_INSTALL_PREFIX, odesc='</path>') SENDMAIL_PATH = Option('Path to sendmail', cf=('reports', 'sendmailpath'), default='/usr/lib/sendmail') -INTERACTIVE = Option('prompt the user for each change', default=False, +INTERACTIVE = Option('Prompt the user for each change', default=False, cmd='-I', ) ENCODING = Option('Encoding of cfg files', default=sys.getdefaultencoding(), cmd='-E', odesc='<encoding>', @@ -201,8 +201,8 @@ PARANOID_MAX_COPIES = Option('Specify the number of paranoid copies you want', OMIT_LOCK_CHECK = Option('Omit lock check', default=False, cmd='-O') CORE_PROFILE = Option('profile', default=False, cmd='-p', ) - -#Metadata options + +# Metadata options MDATA_OWNER = Option('Default Path owner', default='root', cf=('mdata', 'owner'), odesc='owner permissions') @@ -219,7 +219,7 @@ MDATA_PARANOID = Option('Default Path paranoid setting', 'false', cf=('mdata', 'paranoid'), odesc='Path paranoid setting') -#Server options +# Server options SERVER_REPOSITORY = Option('Server repository path', '/var/lib/bcfg2', cf=('server', 'repository'), cmd='-Q', odesc='<repository path>') @@ -255,7 +255,7 @@ SERVER_PASSWORD = Option('Communication Password', cmd='-x', odesc='<password>', cf=('communication', 'password'), default=False) SERVER_PROTOCOL = Option('Server Protocol', cf=('communication', 'procotol'), default='xmlrpc/ssl') -#Client options +# Client options CLIENT_KEY = Option('Path to SSL key', cf=('communication', 'key'), default=None, cmd="--ssl-key", odesc='<ssl key>', long_arg=True) @@ -265,44 +265,44 @@ CLIENT_CERT = Option('Path to SSL certificate', default=None, cmd="--ssl-cert", CLIENT_CA = Option('Path to SSL CA Cert', default=None, cmd="--ca-cert", cf=('communication', 'ca'), odesc='<ca cert>', long_arg=True) -CLIENT_SCNS = Option('list of server commonNames', default=None, cmd="--ssl-cns", +CLIENT_SCNS = Option('List of server commonNames', default=None, cmd="--ssl-cns", cf=('communication', 'serverCommonNames'), odesc='<commonName1:commonName2>', cook=list_split, long_arg=True) -CLIENT_PROFILE = Option('assert the given profile for the host', +CLIENT_PROFILE = Option('Assert the given profile for the host', default=False, cmd='-p', odesc="<profile>") -CLIENT_RETRIES = Option('the number of times to retry network communication', +CLIENT_RETRIES = Option('The number of times to retry network communication', default='3', cmd='-R', cf=('communication', 'retries'), odesc="<retry count>") -CLIENT_DRYRUN = Option('do not actually change the system', +CLIENT_DRYRUN = Option('Do not actually change the system', default=False, cmd='-n', ) CLIENT_EXTRA_DISPLAY = Option('enable extra entry output', default=False, cmd='-e', ) -CLIENT_PARANOID = Option('make automatic backups of config files', +CLIENT_PARANOID = Option('Make automatic backups of config files', default=False, cmd='-P', cf=('client', 'paranoid')) CLIENT_DRIVERS = Option('Specify tool driver set', cmd='-D', cf=('client', 'drivers'), odesc="<driver1,driver2>", cook=list_split, default=Bcfg2.Client.Tools.default) -CLIENT_CACHE = Option('store the configuration in a file', +CLIENT_CACHE = Option('Store the configuration in a file', default=False, cmd='-c', odesc="<cache path>") -CLIENT_REMOVE = Option('force removal of additional configuration items', +CLIENT_REMOVE = Option('Force removal of additional configuration items', default=False, cmd='-r', odesc="<entry type|all>") -CLIENT_BUNDLE = Option('only configure the given bundle(s)', default=[], +CLIENT_BUNDLE = Option('Only configure the given bundle(s)', default=[], cmd='-b', odesc='<bundle:bundle>', cook=colon_split) CLIENT_BUNDLEQUICK = Option('only verify/configure the given bundle(s)', default=False, cmd='-Q') -CLIENT_INDEP = Option('only configure the given bundle(s)', default=False, +CLIENT_INDEP = Option('Only configure the given bundle(s)', default=False, cmd='-z') -CLIENT_KEVLAR = Option('run in kevlar (bulletproof) mode', default=False, +CLIENT_KEVLAR = Option('Run in kevlar (bulletproof) mode', default=False, cmd='-k', ) -CLIENT_DLIST = Option('run client in server decision list mode', default=False, +CLIENT_DLIST = Option('Run client in server decision list mode', default=False, cmd='-l', odesc='<whitelist|blacklist>') -CLIENT_FILE = Option('configure from a file rather than querying the server', +CLIENT_FILE = Option('Configure from a file rather than querying the server', default=False, cmd='-f', odesc='<specification path>') -CLIENT_QUICK = Option('disable some checksum verification', default=False, +CLIENT_QUICK = Option('Disable some checksum verification', default=False, cmd='-q', ) -CLIENT_USER = Option('the user to provide for authentication', default='root', +CLIENT_USER = Option('The user to provide for authentication', default='root', cmd='-u', cf=('communication', 'user'), odesc='<user>') CLIENT_SERVICE_MODE = Option('Set client service mode', default='default', cmd='-s', odesc='<default|disabled|build>') @@ -316,7 +316,7 @@ CLIENT_APT_TOOLS_VAR_PATH = Option('Apt tools var path', CLIENT_SYSTEM_ETC_PATH = Option('System etc path', cf=('APT', 'etc_path'), default='/etc') -#Logging options +# Logging options LOGGING_FILE_PATH = Option('Set path of file log', default=None, cmd='-o', odesc='<path>', cf=('logging', 'path')) diff --git a/src/lib/Server/Admin/Backup.py b/src/lib/Server/Admin/Backup.py index 27a7fd8c8..fefc9fc9e 100644 --- a/src/lib/Server/Admin/Backup.py +++ b/src/lib/Server/Admin/Backup.py @@ -6,8 +6,8 @@ import Bcfg2.Server.Admin import Bcfg2.Options class Backup(Bcfg2.Server.Admin.MetadataCore): - __shorthelp__ = "Make a backup of the Bcfg2 repository." - __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin backup") + __shorthelp__ = "Make a backup of the Bcfg2 repository" + __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin backup\n") #"\n\nbcfg2-admin backup restore") __usage__ = ("bcfg2-admin backup") diff --git a/src/lib/Server/Admin/Bundle.py b/src/lib/Server/Admin/Bundle.py index 893fde489..96a7ba59d 100644 --- a/src/lib/Server/Admin/Bundle.py +++ b/src/lib/Server/Admin/Bundle.py @@ -11,8 +11,8 @@ class Bundle(Bcfg2.Server.Admin.MetadataCore): __longhelp__ = (__shorthelp__ + #"\n\nbcfg2-admin bundle add <bundle> " #"\n\nbcfg2-admin bundle del <bundle>" "\n\nbcfg2-admin bundle list-xml" - "\n\nbcfg2-admin bundle list-genshi" - "\n\nbcfg2-admin bundle show") + "\nbcfg2-admin bundle list-genshi" + "\nbcfg2-admin bundle show\n") __usage__ = ("bcfg2-admin bundle [options] [add|del] [group]") def __init__(self, configfile): @@ -23,7 +23,7 @@ class Bundle(Bcfg2.Server.Admin.MetadataCore): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) reg='((?:[a-z][a-z\\.\\d\\-]+)\\.(?:[a-z][a-z\\-]+))(?![\\w\\.])' - #Get all bundles out of the Bundle/ directory + # Get all bundles out of the Bundle/ directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) diff --git a/src/lib/Server/Admin/Client.py b/src/lib/Server/Admin/Client.py index 0eee22ae4..08bd34151 100644 --- a/src/lib/Server/Admin/Client.py +++ b/src/lib/Server/Admin/Client.py @@ -5,11 +5,11 @@ from Bcfg2.Server.Plugins.Metadata import MetadataConsistencyError class Client(Bcfg2.Server.Admin.MetadataCore): __shorthelp__ = "Create, delete, or modify client entries" __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin client add <client> " - "attr1=val1 attr2=val2\n" - "\n\nbcfg2-admin client update <client> " - "attr1=val1 attr2=val2\n" - "\n\nbcfg2-admin client list\n" - "bcfg2-admin client del <client>") + "attr1=val1 attr2=val2" + "\nbcfg2-admin client update <client> " + "attr1=val1 attr2=val2" + "\nbcfg2-admin client list" + "\nbcfg2-admin client del <client>\n") __usage__ = ("bcfg2-admin client [options] [add|del|update|list] [attr=val]") def __init__(self, configfile): diff --git a/src/lib/Server/Admin/Group.py b/src/lib/Server/Admin/Group.py index 6a1c13775..d4024686d 100644 --- a/src/lib/Server/Admin/Group.py +++ b/src/lib/Server/Admin/Group.py @@ -5,11 +5,11 @@ from Bcfg2.Server.Plugins.Metadata import MetadataConsistencyError class Group(Bcfg2.Server.Admin.MetadataCore): __shorthelp__ = "Create, delete, or modify group entries" __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin group add <group> " - "attr1=val1 attr2=val2\n" - "\n\nbcfg2-admin group update <group> " - "attr1=val1 attr2=val2\n" - "\n\nbcfg2-admin group list\n" - "bcfg2-admin group del <group>") + "attr1=val1 attr2=val2" + "\nbcfg2-admin group update <group> " + "attr1=val1 attr2=val2" + "\nbcfg2-admin group list" + "bcfg2-admin group del <group>\n") __usage__ = ("bcfg2-admin group [options] [add|del|update|list] [attr=val]") def __init__(self, configfile): diff --git a/src/lib/Server/Admin/Init.py b/src/lib/Server/Admin/Init.py index c6d1f9e3d..aee91b244 100644 --- a/src/lib/Server/Admin/Init.py +++ b/src/lib/Server/Admin/Init.py @@ -76,15 +76,44 @@ os_list = [ ] # Complete list of plugins -plugin_list = ['Account', 'Base', 'Bundler', 'Cfg', - 'Decisions', 'Deps', 'Metadata', 'Packages', - 'Pkgmgr', 'Probes', 'Properties', 'Rules', - 'Snapshots', 'SSHbase', 'Statistics', 'Svcmgr', - 'TCheetah', 'TGenshi'] +plugin_list = [ + 'Account', + 'Base', + 'Bundler', + 'Bzr', + 'Cfg', + 'Decisions', + 'Deps', + 'Git', + 'Guppy', + 'Hg', + 'Metadata', + 'NagiosGen', + 'Ohai', + 'Packages', + 'Pkgmgr', + 'Probes', + 'Properties', + 'Rules', + 'Snapshots', + 'SSHbase', + 'SSLCA', + 'Statistics', + 'Svcmgr', + 'TCheetah', + 'TGenshi' + ] # Default list of plugins to use -default_plugins = ['SSHbase', 'Cfg', 'Pkgmgr', 'Rules', - 'Metadata', 'Base', 'Bundler'] +default_plugins = [ + 'Base', + 'Bundler' + 'Cfg', + 'Metadata', + 'Pkgmgr', + 'Rules', + 'SSHbase' + ] def gen_password(length): """Generates a random alphanumeric password with length characters.""" @@ -94,16 +123,16 @@ def gen_password(length): newpasswd = newpasswd + random.choice(chars) return newpasswd -def create_key(hostname, keypath, certpath): +def create_key(hostname, keypath, certpath, country, state, location): """Creates a bcfg2.key at the directory specifed by keypath.""" - kcstr = "openssl req -batch -x509 -nodes -subj '/C=US/ST=Illinois/L=Argonne/CN=%s' -days 1000 -newkey rsa:2048 -keyout %s -noout" % (hostname, keypath) + kcstr = "openssl req -batch -x509 -nodes -subj '/C=%s/ST=%s/L=%s/CN=%s' -days 1000 -newkey rsa:2048 -keyout %s -noout" % (country, state, location, hostname, keypath) subprocess.call((kcstr), shell=True) - ccstr = "openssl req -batch -new -subj '/C=US/ST=Illinois/L=Argonne/CN=%s' -key %s | openssl x509 -req -days 1000 -signkey %s -out %s" % (hostname, keypath, keypath, certpath) + ccstr = "openssl req -batch -new -subj '/C=%s/ST=%s/L=%s/CN=%s' -key %s | openssl x509 -req -days 1000 -signkey %s -out %s" % (country, state, location, hostname, keypath, keypath, certpath) subprocess.call((ccstr), shell=True) os.chmod(keypath, 0600) def create_conf(confpath, confdata): - # don't overwrite existing bcfg2.conf file + # Don't overwrite existing bcfg2.conf file if os.path.exists(confpath): result = raw_input("\nWarning: %s already exists. " "Overwrite? [y/N]: " % confpath) @@ -115,7 +144,7 @@ def create_conf(confpath, confdata): os.chmod(confpath, 0600) except Exception, e: print("Error %s occured while trying to write configuration " - "file to '%s'\n" % + "file to '%s'.\n" % (e, confpath)) raise SystemExit(1) @@ -159,13 +188,16 @@ class Init(Bcfg2.Server.Admin.Mode): self._prompt_hostname() self._prompt_server() self._prompt_groups() + # self._prompt_plugins() + self._prompt_certificate() # Initialize the repository self.init_repo() def _prompt_hostname(self): """Ask for the server hostname.""" - data = raw_input("What is the server's hostname [%s]: " % socket.getfqdn()) + data = raw_input("What is the server's hostname [%s]: " % + socket.getfqdn()) if data != '': self.shostname = data else: @@ -173,7 +205,7 @@ class Init(Bcfg2.Server.Admin.Mode): def _prompt_config(self): """Ask for the configuration file path.""" - newconfig = raw_input("Store bcfg2 configuration in [%s]: " % + newconfig = raw_input("Store Bcfg2 configuration in [%s]: " % self.configfile) if newconfig != '': self.configfile = newconfig @@ -181,12 +213,12 @@ class Init(Bcfg2.Server.Admin.Mode): def _prompt_repopath(self): """Ask for the repository path.""" while True: - newrepo = raw_input("Location of bcfg2 repository [%s]: " % + newrepo = raw_input("Location of Bcfg2 repository [%s]: " % self.repopath) if newrepo != '': self.repopath = newrepo if os.path.isdir(self.repopath): - response = raw_input("Directory %s exists. Overwrite? [y/N]:"\ + response = raw_input("Directory %s exists. Overwrite? [y/N]:" \ % self.repopath) if response.lower().strip() == 'y': break @@ -203,7 +235,8 @@ class Init(Bcfg2.Server.Admin.Mode): def _prompt_server(self): """Ask for the server name.""" - newserver = raw_input("Input the server location [%s]: " % self.server_uri) + newserver = raw_input("Input the server location [%s]: " % + self.server_uri) if newserver != '': self.server_uri = newserver @@ -221,7 +254,8 @@ class Init(Bcfg2.Server.Admin.Mode): continue def _prompt_plugins(self): - default = raw_input("Use default plugins? (%s) [Y/n]: " % ''.join(default_plugins)).lower() + default = raw_input("Use default plugins? (%s) [Y/n]: " % + ''.join(default_plugins)).lower() if default != 'y' or default != '': while True: plugins_are_valid = True @@ -231,15 +265,45 @@ class Init(Bcfg2.Server.Admin.Mode): plugin = plugin.strip() if not plugin in plugin_list: plugins_are_valid = False - print "ERROR: plugin %s not recognized" % plugin + print "ERROR: Plugin %s not recognized" % plugin if plugins_are_valid: break + def _prompt_certificate(self): + """Ask for the key details (country, state, and location).""" + print "The following questions affects the certificate." + print "If there are no data provided the default values are used." + newcountry = raw_input("Country name (2 letter code) for certificate: ") + if newcountry != '': + if len(newcountry) == 2: + self.country = newcountry + else: + while len(newcountry) != 2: + newcountry = raw_input("2 letter country code (eg. US): ") + if len(newcountry) == 2: + self.country = newcountry + break + else: + self.country = 'US' + + newstate = raw_input("State or Province Name (full name) for certificate: ") + if newstate != '': + self.state = newstate + else: + self.state = 'Illinois' + + newlocation = raw_input("Locality Name (eg, city) for certificate: ") + if newlocation != '': + self.location = newlocation + else: + self.location = 'Argonne' + def _init_plugins(self): """Initialize each plugin-specific portion of the repository.""" for plugin in self.plugins: if plugin == 'Metadata': - Bcfg2.Server.Plugins.Metadata.Metadata.init_repo(self.repopath, groups, self.os_sel, clients) + Bcfg2.Server.Plugins.Metadata.Metadata.init_repo(self.repopath, + groups, self.os_sel, clients) else: try: module = __import__("Bcfg2.Server.Plugins.%s" % plugin, '', @@ -247,7 +311,8 @@ class Init(Bcfg2.Server.Admin.Mode): cls = getattr(module, plugin) cls.init_repo(self.repopath) except Exception, e: - print 'Plugin setup for %s failed: %s\n Check that dependencies are installed?' % (plugin, e) + print 'Plugin setup for %s failed: %s' + print 'Check that dependencies are installed?' % (plugin, e) def init_repo(self): """Setup a new repo and create the content of the configuration file.""" @@ -268,7 +333,8 @@ class Init(Bcfg2.Server.Admin.Mode): create_conf(self.configfile, confdata) kpath = keypath + '/bcfg2.key' cpath = keypath + '/bcfg2.crt' - create_key(self.shostname, kpath, cpath) + create_key(self.shostname, kpath, cpath, self.country, + self.state, self.location) # Create the repository path = "%s/%s" % (self.repopath, 'etc') diff --git a/src/lib/Server/Admin/Minestruct.py b/src/lib/Server/Admin/Minestruct.py index 02edf2b75..abe1d5a7a 100644 --- a/src/lib/Server/Admin/Minestruct.py +++ b/src/lib/Server/Admin/Minestruct.py @@ -9,7 +9,7 @@ class Minestruct(Bcfg2.Server.Admin.StructureMode): __shorthelp__ = "Extract extra entry lists from statistics" __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin minestruct [-f filename] " - "[-g groups] client") + "[-g groups] client\n") __usage__ = ("bcfg2-admin minestruct [options] <client>\n\n" " %-25s%s\n" " %-25s%s\n" % diff --git a/src/lib/Server/Admin/Perf.py b/src/lib/Server/Admin/Perf.py index 6f1cb8dbb..095180592 100644 --- a/src/lib/Server/Admin/Perf.py +++ b/src/lib/Server/Admin/Perf.py @@ -6,7 +6,7 @@ import sys class Perf(Bcfg2.Server.Admin.Mode): __shorthelp__ = ("Query server for performance data") - __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin perf") + __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin perf\n") __usage__ = ("bcfg2-admin perf") def __init__(self, configfile): diff --git a/src/lib/Server/Admin/Pull.py b/src/lib/Server/Admin/Pull.py index 289852f79..926eda1b3 100644 --- a/src/lib/Server/Admin/Pull.py +++ b/src/lib/Server/Admin/Pull.py @@ -9,7 +9,7 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): __shorthelp__ = ("Integrate configuration information " "from clients into the server repository") __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin pull [-v] [-f][-I] [-s] " - "<client> <entry type> <entry name>") + "<client> <entry type> <entry name>\n") __usage__ = ("bcfg2-admin pull [options] <client> <entry type> " "<entry name>\n\n" " %-25s%s\n" @@ -117,7 +117,7 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): new_entry = self.BuildNewEntry(client, etype, ename) meta = self.bcore.build_metadata(client) - # find appropriate plugin in bcore + # Find appropriate plugin in bcore glist = [gen for gen in self.bcore.generators if ename in gen.Entries.get(etype, {})] if len(glist) != 1: @@ -135,7 +135,7 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): except Bcfg2.Server.Plugin.PluginExecutionError: self.errExit("Configuration upload not supported by plugin %s" \ % (plugin.name)) - # commit if running under a VCS + # Commit if running under a VCS for vcsplugin in self.bcore.plugins.values(): if isinstance(vcsplugin, Bcfg2.Server.Plugin.Version): files = "%s/%s" % (plugin.data, ename) diff --git a/src/lib/Server/Admin/Snapshots.py b/src/lib/Server/Admin/Snapshots.py index 004de0ddb..d58873174 100644 --- a/src/lib/Server/Admin/Snapshots.py +++ b/src/lib/Server/Admin/Snapshots.py @@ -1,7 +1,7 @@ from datetime import date import sys -# prereq issues can be signaled with ImportError, so no try needed +# Prereq issues can be signaled with ImportError, so no try needed import sqlalchemy, sqlalchemy.orm import Bcfg2.Server.Admin import Bcfg2.Server.Snapshots @@ -11,14 +11,15 @@ from Bcfg2.Server.Snapshots.model import Snapshot, Client, Metadata, Base, \ class Snapshots(Bcfg2.Server.Admin.Mode): __shorthelp__ = "Interact with the Snapshots system" - __longhelp__ = (__shorthelp__) + __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin snapshots init" + "\nbcfg2-admin query qtype\n") __usage__ = ("bcfg2-admin snapshots [init|query qtype]") - q_dispatch = {'client':Client, - 'group':Group, - 'metadata':Metadata, - 'package':Package, - 'snapshot':Snapshot} + q_dispatch = {'client': Client, + 'group': Group, + 'metadata': Metadata, + 'package': Package, + 'snapshot': Snapshot} def __init__(self, configfile): Bcfg2.Server.Admin.Mode.__init__(self, configfile) diff --git a/src/lib/Server/Admin/Tidy.py b/src/lib/Server/Admin/Tidy.py index c02ddf110..cc8ab4f5e 100644 --- a/src/lib/Server/Admin/Tidy.py +++ b/src/lib/Server/Admin/Tidy.py @@ -6,7 +6,7 @@ import Bcfg2.Server.Admin class Tidy(Bcfg2.Server.Admin.Mode): __shorthelp__ = "Clean up useless files in the repo" - __longhelp__ = __shorthelp__ + "\n\nbcfg2-admin tidy [-f] [-I]" + __longhelp__ = __shorthelp__ + "\n\nbcfg2-admin tidy [-f] [-I]\n" __usage__ = ("bcfg2-admin tidy [options]\n\n" " %-25s%s\n" " %-25s%s\n" % diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py index 245ca8398..e3daea84b 100644 --- a/src/lib/Server/Admin/Viz.py +++ b/src/lib/Server/Admin/Viz.py @@ -6,7 +6,7 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): __shorthelp__ = "Produce graphviz diagrams of metadata structures" __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin viz [--includehosts] " "[--includebundles] [--includekey] " - "[-o output.png] [--raw]") + "[-o output.png] [--raw]\n") __usage__ = ("bcfg2-admin viz [options]\n\n" " %-25s%s\n" " %-25s%s\n" @@ -24,6 +24,7 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): colors = ['steelblue1', 'chartreuse', 'gold', 'magenta', 'indianred1', 'limegreen', 'orange1', 'lightblue2', 'green1', 'blue1', 'yellow1', 'darkturquoise', 'gray66'] + plugin_blacklist = ['DBStats', 'Snapshots', 'Cfg', 'Pkgmgr', 'Packages', 'Rules', 'Account', 'Decisions', 'Deps', 'Git', 'Svn', 'Fossil', 'Bzr', 'Bundler', 'TGenshi', 'SGenshi', 'Base'] diff --git a/src/lib/Server/Admin/Xcmd.py b/src/lib/Server/Admin/Xcmd.py index 80d5cfb25..8ea98b79c 100644 --- a/src/lib/Server/Admin/Xcmd.py +++ b/src/lib/Server/Admin/Xcmd.py @@ -7,7 +7,7 @@ import xmlrpclib class Xcmd(Bcfg2.Server.Admin.Mode): __shorthelp__ = ("XML-RPC Command Interface") - __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin xcmd command") + __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin xcmd command\n") __usage__ = ("bcfg2-admin xcmd <command>") def __call__(self, args): diff --git a/src/lib/Server/Admin/__init__.py b/src/lib/Server/Admin/__init__.py index a22d8521a..dc3dc8c01 100644 --- a/src/lib/Server/Admin/__init__.py +++ b/src/lib/Server/Admin/__init__.py @@ -94,7 +94,7 @@ class Mode(object): item in col]) for col in cols] borderline = vdelim.join([w*hdelim for w in colWidths]) - # print out the table + # Print out the table print(borderline) for row in rows: print(vdelim.join([justify(str(item), width) for \ |