← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1471168] [NEW] config option 's parameter choices can check value before using it

 

Public bug reported:

In oslo.config   StrOpt provide parameter choices,  that means the
option's value must be in the choices, otherewise an exception will be
raised. The current exception is NoSuchOptError[1],   a more meaningful
exception should be raised [2].

In other word, if an exception will be raised if we set wrong value(not
in choices). So in Nova code, we don't need check the value if is
valid.  The check code  is duplicated , we can remove them.

[1]https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L1899
[2]https://bugs.launchpad.net/bugs/1471149

** Affects: nova
     Importance: Undecided
     Assignee: ChangBo Guo(gcb) (glongwave)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1471168

Title:
  config option 's parameter choices can check value before using it

Status in OpenStack Compute (Nova):
  In Progress

Bug description:
  In oslo.config   StrOpt provide parameter choices,  that means the
  option's value must be in the choices, otherewise an exception will be
  raised. The current exception is NoSuchOptError[1],   a more
  meaningful exception should be raised [2].

  In other word, if an exception will be raised if we set wrong
  value(not in choices). So in Nova code, we don't need check the value
  if is  valid.  The check code  is duplicated , we can remove them.

  [1]https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L1899
  [2]https://bugs.launchpad.net/bugs/1471149

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1471168/+subscriptions


Follow ups

References