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'
Reviewed: https:/ /review. openstack. org/226993 /git.openstack. org/cgit/ openstack/ oslo.config/ commit/ ?id=934ae9b34f7 ab4bba5b1a4573a 714d803a4c1707
Committed: https:/
Submitter: Jenkins
Branch: master
commit 934ae9b34f7ab4b ba5b1a4573a714d 803a4c1707
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: config. cfg.ConfigFileV alueError: Value for option foo is not
oslo_
valid: Valid values are [bar, baz], but found 'boo'
Closes-Bug: #1499074 7b47bae77ef12f4 35b7c3712ab
Change-Id: I694d8aa99c861c