diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-05-21 15:19:03 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-05-21 15:19:03 -0400 |
commit | 1a43d45badb0c5127b75dfef436bd45af5ed916c (patch) | |
tree | b8de6ab35e2275cae17ce6e89c3c7087b997c237 | |
parent | 5bdcf1ce5fb01aeca47d36f5b96924182c950869 (diff) | |
download | bcfg2-1a43d45badb0c5127b75dfef436bd45af5ed916c.tar.gz bcfg2-1a43d45badb0c5127b75dfef436bd45af5ed916c.tar.bz2 bcfg2-1a43d45badb0c5127b75dfef436bd45af5ed916c.zip |
added option groups
-rw-r--r-- | src/lib/Bcfg2/Options.py | 51 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/__init__.py | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Core.py | 2 | ||||
-rwxr-xr-x | src/sbin/bcfg2 | 86 | ||||
-rwxr-xr-x | src/sbin/bcfg2-admin | 15 | ||||
-rwxr-xr-x | src/sbin/bcfg2-info | 31 | ||||
-rwxr-xr-x | src/sbin/bcfg2-lint | 40 | ||||
-rwxr-xr-x | src/sbin/bcfg2-server | 34 | ||||
-rwxr-xr-x | src/sbin/bcfg2-test | 20 |
9 files changed, 105 insertions, 177 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index 551a4fe42..d1e5dae68 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -258,16 +258,11 @@ PARANOID_MAX_COPIES = Option('Specify the number of paranoid copies you want', default=1, cf=('paranoid', 'max_copies'), odesc='<max paranoid copies>') OMIT_LOCK_CHECK = Option('Omit lock check', default=False, cmd='-O') -CORE_PROFILE = Option('profile', - default=False, cmd='-p', ) -FILES_ON_STDIN = Option('Operate on a list of files supplied on stdin', - cmd='--stdin', default=False, long_arg=True) +CORE_PROFILE = Option('profile', default=False, cmd='-p', ) SCHEMA_PATH = Option('Path to XML Schema files', cmd='--schema', odesc='<schema path>', default="%s/share/bcfg2/schemas" % DEFAULT_INSTALL_PREFIX, long_arg=True) -REQUIRE_SCHEMA = Option("Require property files to have matching schema files", - cmd="--require-schema", default=False, long_arg=True) # Metadata options MDATA_OWNER = Option('Default Path owner', @@ -379,9 +374,6 @@ CLIENT_INDEP = Option('Only configure independent entries, ignore bundles', defa cmd='-z') CLIENT_KEVLAR = Option('Run in kevlar (bulletproof) mode', default=False, cmd='-k', ) -CLIENT_DLIST = Option('Run client in server decision list mode', default='none', - cf=('client', 'decision'), - cmd='-l', odesc='<whitelist|blacklist|none>') 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, @@ -393,8 +385,14 @@ CLIENT_SERVICE_MODE = Option('Set client service mode', default='default', CLIENT_TIMEOUT = Option('Set the client XML-RPC timeout', default=90, cmd='-t', cf=('communication', 'timeout'), odesc='<timeout>') +CLIENT_DLIST = Option('Run client in server decision list mode', default='none', + cf=('client', 'decision'), + cmd='-l', odesc='<whitelist|blacklist|none>') +CLIENT_DECISION_LIST = Option('Decision List', default=False, + cmd="--decision-list", odesc='<file>', + long_arg=True) -# bcfg2-test options +# bcfg2-test and bcfg2-lint options TEST_NOSEOPTS = Option('Options to pass to nosetests', default=[], cmd='--nose-options', cf=('bcfg2_test', 'nose_options'), odesc='<opts>', long_arg=True, cook=shlex.split) @@ -402,6 +400,13 @@ TEST_IGNORE = Option('Ignore these entries if they fail to build.', default=[], cmd='--ignore', cf=('bcfg2_test', 'ignore_entries'), long_arg=True, odesc='<Type>:<name>,<Type>:<name>', cook=list_split) +LINT_CONFIG = Option('Specify bcfg2-lint configuration file', + '/etc/bcfg2-lint.conf', cmd='--lint-config', + odesc='<conffile>', long_arg=True) +LINT_SHOW_ERRORS = Option('Show error handling', False, cmd='--list-errors', + long_arg=True) +LINT_FILES_ON_STDIN = Option('Operate on a list of files supplied on stdin', + cmd='--stdin', default=False, long_arg=True) # APT client tool options CLIENT_APT_TOOLS_INSTALL_PATH = Option('Apt tools install path', @@ -410,7 +415,7 @@ CLIENT_APT_TOOLS_INSTALL_PATH = Option('Apt tools install path', CLIENT_APT_TOOLS_VAR_PATH = Option('Apt tools var path', cf=('APT', 'var_path'), default='/var') CLIENT_SYSTEM_ETC_PATH = Option('System etc path', cf=('APT', 'etc_path'), - default='/etc') + default='/etc') # Logging options LOGGING_FILE_PATH = Option('Set path of file log', default=None, @@ -421,6 +426,30 @@ CFG_VALIDATION = Option('Run validation on Cfg files', default=True, cf=('cfg', 'validation'), cmd='--cfg-validation', long_arg=True, cook=get_bool) + +# Option groups +CLI_COMMON_OPTIONS = dict(configfile=CFILE, + debug=DEBUG, + help=HELP, + verbose=VERBOSE, + encoding=ENCODING, + logging=LOGGING_FILE_PATH) + +DAEMON_COMMON_OPTIONS = dict(daemon=DAEMON, + listen_all=SERVER_LISTEN_ALL) + +SERVER_COMMON_OPTIONS = dict(repo=SERVER_REPOSITORY, + plugins=SERVER_PLUGINS, + password=SERVER_PASSWORD, + filemonitor=SERVER_FILEMONITOR, + ignore=SERVER_FAM_IGNORE, + location=SERVER_LOCATION, + static=SERVER_STATIC, + key=SERVER_KEY, + cert=SERVER_CERT, + ca=SERVER_CA, + protocol=SERVER_PROTOCOL) + class OptionParser(OptionSet): """ OptionParser bootstraps option parsing, diff --git a/src/lib/Bcfg2/Server/Admin/__init__.py b/src/lib/Bcfg2/Server/Admin/__init__.py index 618fa450e..a7269a289 100644 --- a/src/lib/Bcfg2/Server/Admin/__init__.py +++ b/src/lib/Bcfg2/Server/Admin/__init__.py @@ -123,9 +123,8 @@ class MetadataCore(Mode): setup['password'], setup['encoding'], filemonitor=setup['filemonitor'], + cfile=setup['configfile'], setup=setup) - if setup['event debug']: - self.bcore.fam.debug = True except Bcfg2.Server.Core.CoreInitError: msg = sys.exc_info()[1] self.errExit("Core load failed: %s" % msg) diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py index c8ef5b1f7..898d5e20e 100644 --- a/src/lib/Bcfg2/Server/Core.py +++ b/src/lib/Bcfg2/Server/Core.py @@ -79,8 +79,6 @@ class Core(Component): famargs['ignore'] = setup['ignore'] if 'debug' in setup: famargs['debug'] = setup['debug'] - elif 'event debug' in setup: - famargs['debug'] = setup['event debug'] try: self.fam = fm(**famargs) except IOError: diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index fb34e627b..e3af04ec5 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -27,10 +27,6 @@ def cb_sigint_handler(signum, frame): """Exit upon CTRL-C.""" os._exit(1) -DECISION_LIST = Bcfg2.Options.Option('Decision List', default=False, - cmd="--decision-list", odesc='<file>', - long_arg=True) - class Client: """The main bcfg2 client class""" @@ -38,46 +34,36 @@ class Client: def __init__(self): self.toolset = None self.config = None - - optinfo = { - # 'optname': (('-a', argdesc, optdesc), - # env, cfpath, default, boolean)), - 'verbose': Bcfg2.Options.VERBOSE, - 'extra': Bcfg2.Options.CLIENT_EXTRA_DISPLAY, - 'quick': Bcfg2.Options.CLIENT_QUICK, - 'debug': Bcfg2.Options.DEBUG, - 'lockfile': Bcfg2.Options.LOCKFILE, - 'drivers': Bcfg2.Options.CLIENT_DRIVERS, - 'dryrun': Bcfg2.Options.CLIENT_DRYRUN, - 'paranoid': Bcfg2.Options.CLIENT_PARANOID, - 'bundle': Bcfg2.Options.CLIENT_BUNDLE, - 'bundle-quick': Bcfg2.Options.CLIENT_BUNDLEQUICK, - 'indep': Bcfg2.Options.CLIENT_INDEP, - 'file': Bcfg2.Options.CLIENT_FILE, - 'interactive': Bcfg2.Options.INTERACTIVE, - 'cache': Bcfg2.Options.CLIENT_CACHE, - 'profile': Bcfg2.Options.CLIENT_PROFILE, - 'remove': Bcfg2.Options.CLIENT_REMOVE, - 'help': Bcfg2.Options.HELP, - 'setup': Bcfg2.Options.CFILE, - 'server': Bcfg2.Options.SERVER_LOCATION, - 'user': Bcfg2.Options.CLIENT_USER, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'retries': Bcfg2.Options.CLIENT_RETRIES, - 'kevlar': Bcfg2.Options.CLIENT_KEVLAR, - 'decision-list': DECISION_LIST, - 'encoding': Bcfg2.Options.ENCODING, - 'omit-lock-check': Bcfg2.Options.OMIT_LOCK_CHECK, - 'filelog': Bcfg2.Options.LOGGING_FILE_PATH, - 'decision': Bcfg2.Options.CLIENT_DLIST, - 'servicemode': Bcfg2.Options.CLIENT_SERVICE_MODE, - 'key': Bcfg2.Options.CLIENT_KEY, - 'certificate': Bcfg2.Options.CLIENT_CERT, - 'ca': Bcfg2.Options.CLIENT_CA, - 'serverCN': Bcfg2.Options.CLIENT_SCNS, - 'timeout': Bcfg2.Options.CLIENT_TIMEOUT, - } - + + optinfo = dict(extra=Bcfg2.Options.CLIENT_EXTRA_DISPLAY, + quick=Bcfg2.Options.CLIENT_QUICK, + lockfile=Bcfg2.Options.LOCKFILE, + drivers=Bcfg2.Options.CLIENT_DRIVERS, + dryrun=Bcfg2.Options.CLIENT_DRYRUN, + paranoid=Bcfg2.Options.CLIENT_PARANOID, + bundle=Bcfg2.Options.CLIENT_BUNDLE, + bundle_quick=Bcfg2.Options.CLIENT_BUNDLEQUICK, + indep=Bcfg2.Options.CLIENT_INDEP, + file=Bcfg2.Options.CLIENT_FILE, + interactive=Bcfg2.Options.INTERACTIVE, + cache=Bcfg2.Options.CLIENT_CACHE, + profile=Bcfg2.Options.CLIENT_PROFILE, + remove=Bcfg2.Options.CLIENT_REMOVE, + server=Bcfg2.Options.SERVER_LOCATION, + user=Bcfg2.Options.CLIENT_USER, + password=Bcfg2.Options.SERVER_PASSWORD, + retries=Bcfg2.Options.CLIENT_RETRIES, + kevlar=Bcfg2.Options.CLIENT_KEVLAR, + omit_lock_check=Bcfg2.Options.OMIT_LOCK_CHECK, + decision=Bcfg2.Options.CLIENT_DLIST, + servicemode=Bcfg2.Options.CLIENT_SERVICE_MODE, + key=Bcfg2.Options.CLIENT_KEY, + certificate=Bcfg2.Options.CLIENT_CERT, + ca=Bcfg2.Options.CLIENT_CA, + serverCN=Bcfg2.Options.CLIENT_SCNS, + timeout=Bcfg2.Options.CLIENT_TIMEOUT, + decision_list=Bcfg2.Options.CLIENT_DECISION_LIST) + optinfo.update(CLI_COMMON_OPTIONS) self.setup = Bcfg2.Options.OptionParser(optinfo) self.setup.parse(sys.argv[1:]) @@ -93,10 +79,10 @@ class Client: Bcfg2.Logger.setup_logging('bcfg2', to_syslog=False, level=level, - to_file=self.setup['filelog']) + to_file=self.setup['logging']) self.logger = logging.getLogger('bcfg2') self.logger.debug(self.setup) - if self.setup['bundle-quick']: + if self.setup['bundle_quick']: if self.setup['bundle'] == []: self.logger.error("-Q option requires -b") raise SystemExit(1) @@ -282,7 +268,7 @@ class Client: self.fatal_error("Server error: %s" % (self.config.text)) return(1) - if self.setup['bundle-quick']: + if self.setup['bundle_quick']: newconfig = Bcfg2.Client.XML.XML('<Configuration/>') [newconfig.append(bundle) for bundle in self.config.getchildren() if \ bundle.tag == 'Bundle' and bundle.get('name') in self.setup['bundle']] @@ -293,7 +279,7 @@ class Client: times, self.setup['drivers'], self.setup['dryrun']) - if not self.setup['omit-lock-check']: + if not self.setup['omit_lock_check']: #check lock here try: lockfile = open(self.setup['lockfile'], 'w') @@ -309,7 +295,7 @@ class Client: # execute the said configuration self.tools.Execute() - if not self.setup['omit-lock-check']: + if not self.setup['omit_lock_check']: #unlock here if lockfile: try: @@ -318,7 +304,7 @@ class Client: except OSError: self.logger.error("Failed to unlock lockfile %s" % lockfile.name) - if not self.setup['file'] and not self.setup['bundle-quick']: + if not self.setup['file'] and not self.setup['bundle_quick']: # upload statistics feedback = self.tools.GenerateStats() diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 7cc19be8f..d628debea 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -36,18 +36,9 @@ def create_description(): return description.getvalue() def main(): - optinfo = { - 'configfile': Bcfg2.Options.CFILE, - 'help': Bcfg2.Options.HELP, - 'verbose': Bcfg2.Options.VERBOSE, - 'repo': Bcfg2.Options.SERVER_REPOSITORY, - 'plugins': Bcfg2.Options.SERVER_PLUGINS, - 'event debug': Bcfg2.Options.DEBUG, - 'filemonitor': Bcfg2.Options.SERVER_FILEMONITOR, - 'ignore': Bcfg2.Options.SERVER_FAM_IGNORE, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'encoding': Bcfg2.Options.ENCODING, - } + optinfo = dict() + optinfo.update(CLI_COMMON_OPTIONS) + optinfo.update(SERVER_COMMON_OPTIONS) setup = Bcfg2.Options.OptionParser(optinfo) # override default help message to include description of all modes setup.hm = "%s\n%s" % (setup.buildHelpMessage(), create_description()) diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index c9772ce6c..08c185368 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -642,29 +642,10 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core): if __name__ == '__main__': Bcfg2.Logger.setup_logging('bcfg2-info', to_syslog=False) - optinfo = { - 'configfile': Bcfg2.Options.CFILE, - 'help': Bcfg2.Options.HELP, - 'event debug': Bcfg2.Options.DEBUG, - 'profile': Bcfg2.Options.CORE_PROFILE, - 'encoding': Bcfg2.Options.ENCODING, - # Server options - 'repo': Bcfg2.Options.SERVER_REPOSITORY, - 'plugins': Bcfg2.Options.SERVER_PLUGINS, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'mconnect': Bcfg2.Options.SERVER_MCONNECT, - 'filemonitor': Bcfg2.Options.SERVER_FILEMONITOR, - 'ignore': Bcfg2.Options.SERVER_FAM_IGNORE, - 'location': Bcfg2.Options.SERVER_LOCATION, - 'static': Bcfg2.Options.SERVER_STATIC, - 'key': Bcfg2.Options.SERVER_KEY, - 'cert': Bcfg2.Options.SERVER_CERT, - 'ca': Bcfg2.Options.SERVER_CA, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'protocol': Bcfg2.Options.SERVER_PROTOCOL, - # More options - 'logging': Bcfg2.Options.LOGGING_FILE_PATH - } + optinfo = dict(profile=Bcfg2.Options.CORE_PROFILE, + mconnect=Bcfg2.Options.SERVER_MCONNECT) + optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) + optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS) setup = Bcfg2.Options.OptionParser(optinfo) setup.hm = "Usage:\n %s\n%s" % (setup.buildHelpMessage(), USAGE) @@ -677,14 +658,14 @@ if __name__ == '__main__': prof = profile.Profile() loop = prof.runcall(infoCore, setup['repo'], setup['plugins'], setup['password'], setup['encoding'], - setup['event debug'], setup['filemonitor'], + setup['debug'], setup['filemonitor'], setup) displayTrace(prof) else: if setup['profile']: print("Profiling functionality not available.") loop = infoCore(setup['repo'], setup['plugins'], setup['password'], - setup['encoding'], setup['event debug'], + setup['encoding'], setup['debug'], setup['filemonitor'], setup) loop.Run(setup['args']) diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint index bc1e5b70e..5368c4b93 100755 --- a/src/sbin/bcfg2-lint +++ b/src/sbin/bcfg2-lint @@ -65,44 +65,16 @@ def load_server(setup): setup['password'], setup['encoding'], filemonitor=setup['filemonitor'], setup=setup) - if setup['event debug']: - core.fam.debug = True core.fam.handle_events_in_interval(4) return core if __name__ == '__main__': - optinfo = { - 'configfile': Bcfg2.Options.CFILE, - 'help': Bcfg2.Options.HELP, - 'verbose': Bcfg2.Options.VERBOSE, - 'event debug': Bcfg2.Options.DEBUG, - 'encoding': Bcfg2.Options.ENCODING, - # Server options - 'repo': Bcfg2.Options.SERVER_REPOSITORY, - 'plugins': Bcfg2.Options.SERVER_PLUGINS, - 'mconnect': Bcfg2.Options.SERVER_MCONNECT, - 'filemonitor': Bcfg2.Options.SERVER_FILEMONITOR, - 'ignore': Bcfg2.Options.SERVER_FAM_IGNORE, - 'location': Bcfg2.Options.SERVER_LOCATION, - 'static': Bcfg2.Options.SERVER_STATIC, - 'key': Bcfg2.Options.SERVER_KEY, - 'cert': Bcfg2.Options.SERVER_CERT, - 'ca': Bcfg2.Options.SERVER_CA, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'protocol': Bcfg2.Options.SERVER_PROTOCOL, - # More options - 'logging': Bcfg2.Options.LOGGING_FILE_PATH, - 'stdin': Bcfg2.Options.FILES_ON_STDIN, - 'schema': Bcfg2.Options.SCHEMA_PATH, - 'config': Bcfg2.Options.Option('Specify bcfg2-lint configuration file', - '/etc/bcfg2-lint.conf', - cmd='--lint-config', - odesc='<conffile>', - long_arg=True), - 'showerrors': Bcfg2.Options.Option('Show error handling', False, - cmd='--list-errors', - long_arg=True), - } + optinto = dict(config=Bcfg2.Options.LINT_CONFIG, + showerrors=Bcfg2.Options.LINT_SHOW_ERRORS, + stdin=Bcfg2.Options.LINT_FILES_ON_STDIN, + schema=Bcfg2.Options.SCHEMA_PATH) + optinfo.update(CLI_COMMON_OPTIONS) + optinfo.update(SERVER_COMMON_OPTIONS) setup = Bcfg2.Options.OptionParser(optinfo) setup.parse(sys.argv[1:]) diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 1b8b0d158..d03edc93e 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -15,31 +15,11 @@ from Bcfg2.Server.Core import CoreInitError logger = logging.getLogger('bcfg2-server') if __name__ == '__main__': - OPTINFO = { - 'configfile': Bcfg2.Options.CFILE, - 'daemon' : Bcfg2.Options.DAEMON, - 'debug' : Bcfg2.Options.DEBUG, - 'help' : Bcfg2.Options.HELP, - 'verbose' : Bcfg2.Options.VERBOSE, - 'to_file' : Bcfg2.Options.LOGGING_FILE_PATH, - 'repo' : Bcfg2.Options.SERVER_REPOSITORY, - 'plugins' : Bcfg2.Options.SERVER_PLUGINS, - 'password' : Bcfg2.Options.SERVER_PASSWORD, - 'fm' : Bcfg2.Options.SERVER_FILEMONITOR, - 'ignore' : Bcfg2.Options.SERVER_FAM_IGNORE, - 'key' : Bcfg2.Options.SERVER_KEY, - 'cert' : Bcfg2.Options.SERVER_CERT, - 'ca' : Bcfg2.Options.SERVER_CA, - 'listen_all': Bcfg2.Options.SERVER_LISTEN_ALL, - 'location' : Bcfg2.Options.SERVER_LOCATION, - 'passwd' : Bcfg2.Options.SERVER_PASSWORD, - 'static' : Bcfg2.Options.SERVER_STATIC, - 'encoding' : Bcfg2.Options.ENCODING, - 'filelog' : Bcfg2.Options.LOGGING_FILE_PATH, - 'protocol' : Bcfg2.Options.SERVER_PROTOCOL, - } - - setup = Bcfg2.Options.OptionParser(OPTINFO) + optinfo = dict() + optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) + optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS) + optinfo.update(Bcfg2.Options.DAEMON_COMMON_OPTIONS) + setup = Bcfg2.Options.OptionParser(optinfo) setup.parse(sys.argv[1:]) try: # check whether the specified bcfg2.conf exists @@ -52,7 +32,7 @@ if __name__ == '__main__': daemon=setup['daemon'], pidfile_name=setup['daemon'], protocol=setup['protocol'], - to_file=setup['to_file'], + to_file=setup['logging'], cfile=setup['configfile'], register=False, cls_kwargs={'repo':setup['repo'], @@ -60,7 +40,7 @@ if __name__ == '__main__': 'password':setup['password'], 'encoding':setup['encoding'], 'ca':setup['ca'], - 'filemonitor':setup['fm'], + 'filemonitor':setup['filemonitor'], 'start_fam_thread':True, 'setup':setup}, keyfile=setup['key'], diff --git a/src/sbin/bcfg2-test b/src/sbin/bcfg2-test index 7ddbb3509..653c24124 100755 --- a/src/sbin/bcfg2-test +++ b/src/sbin/bcfg2-test @@ -61,19 +61,11 @@ class ClientTest(TestCase): id = __str__ def main(): - optinfo = { - 'configfile': Bcfg2.Options.CFILE, - 'help': Bcfg2.Options.HELP, - 'encoding': Bcfg2.Options.ENCODING, - 'repo': Bcfg2.Options.SERVER_REPOSITORY, - 'plugins': Bcfg2.Options.SERVER_PLUGINS, - 'password': Bcfg2.Options.SERVER_PASSWORD, - 'verbose': Bcfg2.Options.VERBOSE, - 'noseopts': Bcfg2.Options.TEST_NOSEOPTS, - 'ignore': Bcfg2.Options.SERVER_FAM_IGNORE, - 'test_ignore': Bcfg2.Options.TEST_IGNORE, - 'validate': Bcfg2.Options.CFG_VALIDATION, - } + optinfo = dict(noseopts=Bcfg2.Options.TEST_NOSEOPTS, + test_ignore=Bcfg2.Options.TEST_IGNORE, + validate=Bcfg2.Options.CFG_VALIDATION) + optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) + optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS) setup = Bcfg2.Options.OptionParser(optinfo) setup.hm = \ "bcfg2-test [options] [client] [client] [...]\nOptions:\n %s" % \ @@ -88,7 +80,7 @@ def main(): setup['plugins'], setup['password'], setup['encoding'], - filemonitor='pseudo', + filemonitor=setup['filemonitor'], setup=setup ) |