Setting "enable_quotas"=False disables Neutron in GUI

Bug #1482354 reported by Michael Hagedorn
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Michael Hagedorn
Kilo
Fix Released
Undecided
Unassigned

Bug Description

Excluding OPENSTACK_NEUTRON_NETWORK["enable_quotas"] or setting to False
will result in Create Network, Create Subnet, Create Router buttons
not showing up when logged in as the demo account. KeyError Exceptions are
thrown.

These three side effects happen because the code in the views use the following construct https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/networks/tables.py#L94

        usages = quotas.tenant_quota_usages(request)
        if usages['networks']['available'] <= 0:

if enable_quotas is false, then quotas.tenant_quota_usages does not add the 'available' node to the usages dict and therefore a KeyError 'available' is thrown. This ends up aborting the whole is_allowed method in horizon.BaseTable and therefore hiding the button.

quotas.tenant_quota_usages will not add the available key for usage items which are disabled.

Changed in horizon:
assignee: nobody → Michael Hagedorn (mike-hagedorn)
status: New → In Progress
description: updated
Revision history for this message
Michael Hagedorn (mike-hagedorn) wrote :
summary: - Setting "enable_quotas"=False breaks GUI
+ Setting "enable_quotas"=False disables Neutron in GUI
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/211310

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Michael Hagedorn (<email address hidden>) on branch: master
Review: https://review.openstack.org/211310
Reason: https://review.openstack.org/#/c/210100 is the same content

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

Reviewed: https://review.openstack.org/210100
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=5ba219acbfddb9b9308a75da361fda915ba61f37
Submitter: Jenkins
Branch: master

commit 5ba219acbfddb9b9308a75da361fda915ba61f37
Author: Mike Hagedorn <email address hidden>
Date: Thu Aug 6 15:43:16 2015 -0400

    Neutron Quota Settings Flag Disables Neutron GUI

    if OPENSTACK_NEUTRON_NETWORK["enable_quotas"] = False buttons will not appear
    and exceptions are thrown. This is because a dict is searched for a key
    ("available") which wont be there if its disabled. This generates a
    KeyError at runtime.

    As currently written enable_quatas -> False essentially disables Neutron usage.
    This is not a desirable outcome.

    This patch shows Neutron related buttons and ignores the quota settings,
    which seems more in line with the notion of disabling quotas.

    Closes-Bug:#1482354
    Change-Id: I9485ddeece74d87317c2587498f5f79d4ffdb66e

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/228329

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

Reviewed: https://review.openstack.org/228329
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=b8e1ce89041dfe6547e875571eb987dd9eae3a03
Submitter: Jenkins
Branch: stable/kilo

commit b8e1ce89041dfe6547e875571eb987dd9eae3a03
Author: Mike Hagedorn <email address hidden>
Date: Thu Aug 6 15:43:16 2015 -0400

    Neutron Quota Settings Flag Disables Neutron GUI

    if OPENSTACK_NEUTRON_NETWORK["enable_quotas"] = False buttons will not appear
    and exceptions are thrown. This is because a dict is searched for a key
    ("available") which wont be there if its disabled. This generates a
    KeyError at runtime.

    As currently written enable_quatas -> False essentially disables Neutron usage.
    This is not a desirable outcome.

    This patch shows Neutron related buttons and ignores the quota settings,
    which seems more in line with the notion of disabling quotas.

    Closes-Bug:#1482354
    Change-Id: I9485ddeece74d87317c2587498f5f79d4ffdb66e
    (cherry picked from commit 5ba219acbfddb9b9308a75da361fda915ba61f37)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-rc1 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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