Comment 2 for bug 1499074

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.openstack.org/226993
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=934ae9b34f7ab4bba5b1a4573a714d803a4c1707
Submitter: Jenkins
Branch: master

commit 934ae9b34f7ab4bba5b1a4573a714d803a4c1707
Author: Davanum Srinivas <email address hidden>
Date: Wed Sep 23 16:55:10 2015 -0400

    Fix bad exception for StrOpt with invalid choice value

    If there's a StrOpt with name foo and say choices ['bar', 'baz'] and the
    config file has a bad value for foo (say 'boo'), then the end user
    will see:
    NoSuchOptError: no such option: foo

    Which gives the wrong impression that somehow the foo was never registered
    which is wrong!

    They should see this instead:
    oslo_config.cfg.ConfigFileValueError: Value for option foo is not
    valid: Valid values are [bar, baz], but found 'boo'

    Closes-Bug: #1499074
    Change-Id: I694d8aa99c861c7b47bae77ef12f435b7c3712ab