summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Bcfg2/Options.py5
-rwxr-xr-xsrc/sbin/bcfg2-lint8
2 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py
index aff8c0733..c0a274e23 100644
--- a/src/lib/Bcfg2/Options.py
+++ b/src/lib/Bcfg2/Options.py
@@ -827,6 +827,11 @@ LINT_CONFIG = \
cmd='--lint-config',
odesc='<conffile>',
long_arg=True)
+LINT_PLUGINS = \
+ Option('bcfg2-lint plugin list',
+ default=None, # default is Bcfg2.Server.Lint.__all__
+ cf=('lint', 'plugins'),
+ cook=list_split)
LINT_SHOW_ERRORS = \
Option('Show error handling',
default=False,
diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint
index b041a0d31..dbe3430d7 100755
--- a/src/sbin/bcfg2-lint
+++ b/src/sbin/bcfg2-lint
@@ -90,10 +90,7 @@ def load_plugins(setup):
elif "bcfg2-repo-validate" in sys.argv[0]:
plugin_list = 'RequiredAttrs,Validate'.split(',')
else:
- try:
- plugin_list = setup.cfp.get('lint', 'plugins').split(',')
- except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
- plugin_list = Bcfg2.Server.Lint.__all__
+ plugin_list = setup['lint_plugins']
allplugins = dict()
for plugin in plugin_list:
@@ -144,7 +141,7 @@ def main():
showerrors=Bcfg2.Options.LINT_SHOW_ERRORS,
stdin=Bcfg2.Options.LINT_FILES_ON_STDIN,
schema=Bcfg2.Options.SCHEMA_PATH,
- plugins=Bcfg2.Options.SERVER_PLUGINS)
+ lint_plugins=Bcfg2.Options.LINT_PLUGINS)
optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS)
optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS)
setup = Bcfg2.Options.OptionParser(optinfo)
@@ -156,6 +153,7 @@ def main():
Bcfg2.Logger.setup_logging('bcfg2-info', **log_args)
setup.cfp.read(setup['lint_config'])
+ setup.reparse()
if setup['stdin']:
files = [s.strip() for s in sys.stdin.readlines()]