"action_type" type not validated by REST API

Bug #1462683 reported by Ivar Lazzaro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
In Progress
Medium
Ivar Lazzaro

Bug Description

When creating a policy action, the "action_type" field is not validated to be a string by the REST API.
This causes issues when a different type (eg. boolean) is posted in place of a string:

2015-06-06 02:11:53.550 ERROR neutron.api.v2.resource [req-26e4b488-67d1-4a04-832c-f79756c9fb17 demo demo] create failed
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource Traceback (most recent call last):
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/resource.py", line 83, in resource
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource result = method(request=request, **args)
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 392, in create
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource allow_bulk=self._allow_bulk)
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 650, in prepare_request_body
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource res_dict[attr] = attr_vals['convert_to'](res_dict[attr])
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource File "/opt/stack/new/group-based-policy/gbpservice/neutron/extensions/group_policy.py", line 224, in convert_action_to_case_insensitive
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource return value.lower()
2015-06-06 02:11:53.550 23045 ERROR neutron.api.v2.resource AttributeError: 'bool' object has no attribute 'lower'

Ivar Lazzaro (mmaleckk)
Changed in group-based-policy:
assignee: nobody → Ivar Lazzaro (mmaleckk)
Changed in group-based-policy:
milestone: none → kilo-gbp-4
importance: Undecided → Medium
status: New → Confirmed
Changed in group-based-policy:
milestone: kilo-gbp-4 → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (master)

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

Changed in group-based-policy:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on group-based-policy (master)

Change abandoned by Sumit Naiksatam (<email address hidden>) on branch: master
Review: https://review.openstack.org/273307
Reason: Old patch, probably not needed, can be revived if needed.

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.