need to document correct format for DictOpt options

Bug #1413389 reported by Jason Dunsmore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
Fix Released
Low
Davanum Srinivas (DIMS)

Bug Description

I added a new DictOpt option using:

    cfg.DictOpt('hidden_stack_tags',
                default={},
                help=_('Stacks containing these tag names will be hidden.')),

When I add this entry into the config file:

hidden_stack_tags = {'source': 'heat'}

The value is parsed as:

{"{'source'": "'heat'}"}

The value should be parsed as:

{'source': 'heat'}

Here's another example http://www.giantflyingsaucer.com/blog/?p=4822

Tags: doc
Revision history for this message
Jason Dunsmore (jasondunsmore) wrote :

dims pointed me to the test cases, where I saw that I was using the wrong format. It should be "option = key:value". Maybe this should be added to the docs?

summary: - DictOpt incorrectly parses dicts
+ need to document correct format for DictOpt options
Changed in oslo.config:
status: New → Triaged
importance: Undecided → Low
tags: added: doc
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

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

Changed in oslo.config:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.openstack.org/227353
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=046be3b1fd310133a57bd831100c34a3d5c27926
Submitter: Jenkins
Branch: master

commit 046be3b1fd310133a57bd831100c34a3d5c27926
Author: Davanum Srinivas <email address hidden>
Date: Thu Sep 24 10:55:11 2015 -0400

    Document DictOpt class

    There was confusion caused by the name of the class itself, so
    let's document how the configuration is actually specified in
    the config file

    Closes-Bug: #1413389
    Change-Id: I1b8e2efc7ef76afb0c2bfeb6fe9455f63e4a28a2

Changed in oslo.config:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/227547
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=3226a4777d0192db7cc4d6f2fa321259c04a2400
Submitter: Jenkins
Branch: master

commit 3226a4777d0192db7cc4d6f2fa321259c04a2400
Author: Doug Hellmann <email address hidden>
Date: Thu Sep 24 20:40:31 2015 +0000

    fix literal rendering in dictionary options docs

    Fix the syntax error in the python example for dictionary options so
    pygments will render it properly.

    Use a code-block directive to tell pygments that the inline INI file is
    an INI file, since it does not figure that out automatically.

    Closes-Bug: #1413389
    Change-Id: I16441739e6cbfe8ad497aa0860fbc85a4a2d8123

Changed in oslo.config:
milestone: none → 2.5.0
status: Fix Committed → Fix Released
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.