mandatory security group quota even it's an optional extension

Bug #1330632 reported by AARON ZHANG
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Liyingjun
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

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

AARON ZHANG (fenzhang)
tags: added: quotas
Julie Pichon (jpichon)
tags: added: neutron
Liyingjun (liyingjun)
Changed in horizon:
assignee: nobody → Liyingjun (liyingjun)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/101813
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=1246cd32e33451831255236a3abd8e5e4bf236b1
Submitter: Jenkins
Branch: master

commit 1246cd32e33451831255236a3abd8e5e4bf236b1
Author: liyingjun <email address hidden>
Date: Tue Jun 17 23:48:50 2014 +0800

    Exclude security group related quotas when the extension disabled

    When using neutron as network service and security group extension
    disabled, the quotas update workflow will hit some error, because
    'security_group' and 'security_group_rule' are passed to the quotas
    update method for neutron.
    This patch fixes the problem by excluding these two quotas when
    neutron security group extension is disabled.

    Change-Id: I0011e1c0956d3248b748f109d5ab5e93ec55f7d3
    Closes-bug: 1330632

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-2 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/141050

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/icehouse)

Reviewed: https://review.openstack.org/141050
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=91098122fc5cb6be6e0bd02f2bd9710624b2c888
Submitter: Jenkins
Branch: stable/icehouse

commit 91098122fc5cb6be6e0bd02f2bd9710624b2c888
Author: liyingjun <email address hidden>
Date: Tue Jun 17 23:48:50 2014 +0800

    Exclude security group related quotas when the extension disabled

    When using neutron as network service and security group extension
    disabled, the quotas update workflow will hit some error, because
    'security_group' and 'security_group_rule' are passed to the quotas
    update method for neutron.
    This patch fixes the problem by excluding these two quotas when
    neutron security group extension is disabled.

    Change-Id: I0011e1c0956d3248b748f109d5ab5e93ec55f7d3
    Closes-bug: 1330632
    (cherry picked from commit 1246cd32e33451831255236a3abd8e5e4bf236b1)

tags: added: in-stable-icehouse
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.