Backport of Horizon fix for updating disabled security groups quotas

Bug #1338663 reported by Timur Sufiev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Committed
High
Timur Sufiev
5.0.x
Fix Committed
High
Timur Sufiev
5.1.x
Fix Committed
High
Timur Sufiev

Bug Description

[the following text is copy-pasted from https://bugs.launchpad.net/horizon/+bug/1330632]

Our neutron plugin doesn't support security group since it's an optional extension. But when I create project from horizon, i had the following error:

Request body: {u'quota': {u'subnet': 10, u'network': 10, u'floatingip': 50, u'securi\
ty_group_rule': None, u'security_group': None, u'router': 10, u'port': 50}} prepare_request_bo\
dy /opt/stack/neutron/neutron/api/v2/base.py:554
2014-06-11 01:24:30.105 12417 ERROR neutron.api.v2.resource [req-9a3924e5-ac5a-4e0d-b659-460d9\
857da17 None] update failed
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource Traceback (most recent call last):
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron\
/api/v2/resource.py", line 87, in resource
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource result = method(request=reques\
t, **args)
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron\
/extensions/quotasv2.py", line 107, in update
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource EXTENDED_ATTRIBUTES_2_0[RESOUR\
CE_COLLECTION])
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron\
/api/v2/base.py", line 577, in prepare_request_body
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource Controller._verify_attributes(\
res_dict, attr_info)
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron\
/api/v2/base.py", line 624, in _verify_attributes
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest\
(msg)
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource HTTPBadRequest: Unrecognized attri\
bute(s) 'security_group_rule, security_group'
2014-06-11 01:24:30.105 12417 TRACE neutron.api.v2.resource

I traced the code, in openstack_dashboard/dashboards/admin/projects/workflows.py:

class UpdateProjectQuota(workflows.Step):
    action_class = UpdateProjectQuotaAction
    depends_on = ("project_id",)
    contributes = quotas.QUOTA_FIELDS

it sends everything in quotas.QUOTA_FIELDS to neutron. The quotas.QUOTA_FIELDS has hard coded 'security_group' and 'security_group_rule' in it. So even security group is an optional extension and it's not supported in our plugin, but 'security_group' and 'security_group_rule' still presents in the request and cause the error.

Please also refer:
https://answers.launchpad.net/horizon/+question/250120

Thanks,
Aaron

Tags: horizon
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :
Changed in mos:
status: New → Fix Committed
Timur Sufiev (tsufiev-x)
Changed in mos:
milestone: 5.0.1 → 5.1
Changed in mos:
importance: Undecided → High
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.