mandatory security group quota even it's an optional extension?

Asked by AARON ZHANG on 2014-06-11

Our neutron plugin doesn't support security group since it's an optional extension. But when I try to 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.

Is it the right behavior or it's a bug?

Thanks,
Aaron

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Dashboard (Horizon) Edit question
Assignee:
No assignee Edit question
Solved by:
Julie Pichon
Solved:
2014-06-16
Last query:
2014-06-16
Last reply:
2014-06-16
AARON ZHANG (fenzhang) said : #2

Thanks Julie Pichon, that solved my question.