diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-23 17:42:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-23 17:42:18 +0000 |
| commit | 48ff34812ae6e3b9e59f842d3cb9fc95329ec99f (patch) | |
| tree | 97abc7f336afd90ed6f3c7a9b6cd41dc148d3be5 | |
| parent | 9d11222d27bbb5eb21c324ff3d078b7780ff823d (diff) | |
| parent | 63cc191c2deee369b4076847204d846cf577d78b (diff) | |
Merge "Include CommonConfigOpts options in sample config"
| -rw-r--r-- | etc/nova/nova.conf.sample | 40 | ||||
| -rw-r--r-- | tools/conf/extract_opts.py | 19 |
2 files changed, 51 insertions, 8 deletions
diff --git a/etc/nova/nova.conf.sample b/etc/nova/nova.conf.sample index ede3003cb..d3ad9f8a9 100644 --- a/etc/nova/nova.conf.sample +++ b/etc/nova/nova.conf.sample @@ -4,6 +4,44 @@ [DEFAULT] +######## defined in nova.openstack.common.cfg:CommonConfigOpts ######## + +# debug=false +#### (BoolOpt) Print debugging output + +# verbose=false +#### (BoolOpt) Print more verbose output + +# log_config=<None> +#### (StrOpt) If this option is specified, the logging configuration file +#### specified is used and overrides any other logging options +#### specified. Please see the Python logging module +#### documentation for details on logging configuration files. + +# log_format=%(asctime)s %(levelname)8s [%(name)s] %(message)s +#### (StrOpt) A logging.Formatter log message format string which may use +#### any of the available logging.LogRecord attributes. Default: +#### %default + +# log_date_format=%Y-%m-%d %H:%M:%S +#### (StrOpt) Format string for %(asctime)s in log records. Default: +#### %default + +# log_file=<None> +#### (StrOpt) (Optional) Name of log file to output to. If not set, +#### logging will go to stdout. + +# log_dir=<None> +#### (StrOpt) (Optional) The directory to keep log files in (will be +#### prepended to --logfile) + +# use_syslog=false +#### (BoolOpt) Use syslog for logging. + +# syslog_log_facility=LOG_USER +#### (StrOpt) syslog facility to receive log lines + + ######## defined in nova.crypto ######## # ca_file=cacert.pem @@ -1908,4 +1946,4 @@ #### beprepared. Maximum value is 600 seconds (10 minutes). -# Total option count: 500 +# Total option count: 509 diff --git a/tools/conf/extract_opts.py b/tools/conf/extract_opts.py index 44ae2b000..ed4ad55aa 100644 --- a/tools/conf/extract_opts.py +++ b/tools/conf/extract_opts.py @@ -48,6 +48,8 @@ WORDWRAP_WIDTH = 60 def main(srcfiles): print '\n'.join(['#' * 20, '# nova.conf sample #', '#' * 20, '', '[DEFAULT]', '']) + _list_opts(cfg.CommonConfigOpts, + cfg.__name__ + ':' + cfg.CommonConfigOpts.__name__) mods_by_pkg = dict() for filepath in srcfiles: pkg_name = filepath.split(os.sep)[3] @@ -69,8 +71,6 @@ def main(srcfiles): def _print_module(mod_str): - global OPTION_COUNT - opts = list() mod_obj = None if mod_str.endswith('.__init__'): mod_str = mod_str[:mod_str.rfind(".")] @@ -83,18 +83,23 @@ def _print_module(mod_str): return except Exception, e: return - for attr_str in dir(mod_obj): - attr_obj = getattr(mod_obj, attr_str) + _list_opts(mod_obj, mod_str) + + +def _list_opts(obj, name): + opts = list() + for attr_str in dir(obj): + attr_obj = getattr(obj, attr_str) if isinstance(attr_obj, cfg.Opt): opts.append(attr_obj) elif (isinstance(attr_obj, list) and all(map(lambda x: isinstance(x, cfg.Opt), attr_obj))): opts.extend(attr_obj) - # NOTE(lzyeval): return if module has no options if not opts: return + global OPTION_COUNT OPTION_COUNT += len(opts) - print '######## defined in %s ########\n' % mod_str + print '######## defined in %s ########\n' % name for opt in opts: _print_opt(opt) print @@ -114,7 +119,7 @@ def _wrap(msg, indent): def _print_opt(opt): - opt_name, opt_default, opt_help = opt.name, opt.default, opt.help + opt_name, opt_default, opt_help = opt.dest, opt.default, opt.help if not opt_help: sys.stderr.write('WARNING: "%s" is missing help string.\n' % opt_name) opt_type = None |
