yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #64749
[Bug 1697497] Re: PUT /os-services/force-down won't work with non-boolean forced_down field
We should probably be using oslo_utils.strutils.bool_from_string:
https://github.com/openstack/oslo.utils/blob/master/oslo_utils/strutils.py#L113
** Also affects: nova/newton
Importance: Undecided
Status: New
** Also affects: nova/ocata
Importance: Undecided
Status: New
--
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/1697497
Title:
PUT /os-services/force-down won't work with non-boolean forced_down
field
Status in OpenStack Compute (nova):
Triaged
Status in OpenStack Compute (nova) newton series:
New
Status in OpenStack Compute (nova) ocata series:
New
Bug description:
This API's docs says it takes a boolean for the forced_down field:
https://developer.openstack.org/api-ref/compute/?expanded=update-
forced-down-detail#update-forced-down
But the schema uses the boolean parameter type:
https://github.com/openstack/nova/blob/a43dbba2b8feea063ed2d0c79780b4c3507cf89b/nova/api/openstack/compute/schemas/services.py#L42
Which is not only booleans, it's also things like 'on/off' and
'yes/no':
https://github.com/openstack/nova/blob/a43dbba2b8feea063ed2d0c79780b4c3507cf89b/nova/api/validation/parameter_types.py#L188
Which isn't converted to a boolean:
https://github.com/openstack/nova/blob/a43dbba2b8feea063ed2d0c79780b4c3507cf89b/nova/api/openstack/compute/services.py#L136
That's just passed through to update the service object:
https://github.com/openstack/nova/blob/a43dbba2b8feea063ed2d0c79780b4c3507cf89b/nova/objects/service.py#L151
https://github.com/openstack/nova/blob/a43dbba2b8feea063ed2d0c79780b4c3507cf89b/nova/db/sqlalchemy/models.py#L97
Which is expecting a boolean, so 'yes' or 'on' is going to result in
an error.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1697497/+subscriptions
References