summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Fenn <fennm@deshawresearch.com>2013-03-29 11:09:50 -0400
committerMichael Fenn <fennm@deshawresearch.com>2013-03-29 11:09:50 -0400
commit773d9aaffe82a24146d8b26bf9e8e122c0ec5768 (patch)
tree80b3a951a363f949389046c0c96c32d2984d3ca1
parent3892fa0f0c5214f231cb75a76384f24a92bdbc1d (diff)
downloadbcfg2-773d9aaffe82a24146d8b26bf9e8e122c0ec5768.tar.gz
bcfg2-773d9aaffe82a24146d8b26bf9e8e122c0ec5768.tar.bz2
bcfg2-773d9aaffe82a24146d8b26bf9e8e122c0ec5768.zip
Promote bcfg2-info to have it's own Options dict
Turns out that CLIENT_COMMON_OPTIONS and SERVER_COMMON_OPTIONS conflict. Adding ppath and max_copies (turns out the latter is also necessary) to the bcfg2-info code directly seemed like a maintenance problem waiting to happen, so I factored that out into a new INFO_COMMON_OPTIONS dict. That will keep any options parsing special cases out of the bcfg2-info code hopefully be more maintainable going forward.
-rw-r--r--src/lib/Bcfg2/Options.py4
-rwxr-xr-xsrc/sbin/bcfg2-info3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py
index 7c91ca3cc..3197d2682 100644
--- a/src/lib/Bcfg2/Options.py
+++ b/src/lib/Bcfg2/Options.py
@@ -1269,6 +1269,10 @@ TEST_COMMON_OPTIONS = dict(noseopts=TEST_NOSEOPTS,
xunit=TEST_XUNIT,
validate=CFG_VALIDATION)
+INFO_COMMON_OPTIONS = dict(ppath=PARANOID_PATH,
+ max_copies=PARANOID_MAX_COPIES)
+INFO_COMMON_OPTIONS.update(CLI_COMMON_OPTIONS)
+INFO_COMMON_OPTIONS.update(SERVER_COMMON_OPTIONS)
class OptionParser(OptionSet):
"""
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index cfcc95be2..391902e44 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -754,8 +754,7 @@ def main():
optinfo = dict(profile=Bcfg2.Options.CORE_PROFILE,
interactive=Bcfg2.Options.INTERACTIVE,
interpreter=Bcfg2.Options.INTERPRETER)
- optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS)
- optinfo.update(Bcfg2.Options.SERVER_COMMON_OPTIONS)
+ optinfo.update(Bcfg2.Options.INFO_COMMON_OPTIONS)
setup = Bcfg2.Options.OptionParser(optinfo)
setup.hm = "\n".join([" bcfg2-info [options] [command <command args>]",
"Options:",