sample config file contains options with hyphens

Bug #1034970 reported by David Kranz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Mark McLoughlin

Bug Description

$ find . -name "*.py" | xargs fgrep log-
./nova/openstack/common/cfg.py: StrOpt('log-config',
./nova/openstack/common/cfg.py: StrOpt('log-format',
./nova/openstack/common/cfg.py: StrOpt('log-date-format',
./nova/openstack/common/cfg.py: StrOpt('log-file',
./nova/openstack/common/cfg.py: StrOpt('log-dir',
./nova/openstack/common/cfg.py: StrOpt('syslog-log-facility',

The actual code uses log_config, etc. These go directly to nova.conf.sample and into the public docs which are
therefore wrong http://docs.openstack.org/essex/openstack-compute/admin/content/compute-options-reference.html

Revision history for this message
Mark McLoughlin (markmc) wrote :

The bug here is with the nova.conf.sample generation - it should use opt.dest not opt.name

Revision history for this message
David Kranz (david-kranz) wrote :

I'm not sure about that. I stumbled across this issue because I put 'use-syslog' in a nova.conf file and it did not work. Using 'use_syslog' did work. So this seems like more than a doc extraction issue. These flags are basically the only ones in the source that use '-'.

Revision history for this message
David Kranz (david-kranz) wrote :

Perhaps the existing code is not "wrong" but it would be a lot less confusing if these were just changed to _. I would be happy to do it.

Revision history for this message
Mark McLoughlin (markmc) wrote :

https://review.openstack.org/#/c/11083/ was the proposed openstack-common patch

--use-syslog is the command line option, use_syslog is what goes in the config file

the choice of hyphen is specifically because they are also command line options. See the way the opts are registered with register_cli_opt()

Again, the sample conf file generator just needs to use opt.dest not opt.name

 - opt_name, opt_default, opt_help = opt.name, opt.default, opt.help
 + opt_name, opt_default, opt_help = opt.dest, opt.default, opt.help

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
milestone: none → folsom-rc1
summary: - config for logging options uses dash but code uses underscore
+ sample config file contains options with hyphens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11863

Changed in nova:
assignee: nobody → Mark McLoughlin (markmc)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11863
Committed: http://github.com/openstack/nova/commit/63cc191c2deee369b4076847204d846cf577d78b
Submitter: Jenkins
Branch: master

commit 63cc191c2deee369b4076847204d846cf577d78b
Author: Mark McLoughlin <email address hidden>
Date: Thu Aug 23 10:35:17 2012 +0100

    Include CommonConfigOpts options in sample config

    Options defined by CommonConfigOpts are declared within the class rather
    than at module level, so they weren't being included in the sample conf.

    Also, in essex (and up until commit 991614add8), the sample conf file
    didn't contain these options but they included the hyphen in the name.
    The hyphen is only used on the command line, it is converted to an
    underscore automatically in the config file. Use opt.dest rather than
    opt.name as the config file key. Fixes bug #1034970.

    DocImpact: update nova.conf docs
    Change-Id: Ia7f3dded9148deedeb198c19a8d343db6dd93f99

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.