Disabled neutron quota breaks "Create subnet" button

Bug #1567529 reported by Paul Karikh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Akihiro Motoki

Bug Description

If we set OPENSTACK_NEUTRON_NETWORK= {'enable_quotas': False}, "Create subnet" button dissapears and we get the following error:

Error while checking action permissions.
Traceback (most recent call last):
  File "horizon/horizon/tables/base.py", line 1278, in _filter_action
    return action._allowed(request, datum) and row_matched
  File "horizon/horizon/tables/actions.py", line 136, in _allowed
    self.allowed(request, datum))
  File "horizon/openstack_dashboard/dashboards/project/networks/subnets/tables.py", line 103, in allowed
    if usages['subnets']['available'] <= 0:
KeyError: 'available'
Error while checking action permissions.

Steps to reproduce:
1) Set 'enable_quotas': False in OPENSTACK_NEUTRON_NETWORK
2) Restart Horizon
3) Go to Project/Networks
4) Click on any network
5) Note that you've got "Delete" button, but there is no "Create" button
6) Enable neutron quotas again and make sure that "Create" button appeared

There were already patch[1] for fixing this but looks like this piece of code has been missed.

[1] https://github.com/openstack/horizon/commit/5ba219acbfddb9b9308a75da361fda915ba61f37#diff-6f73ca5e50c3e694b8147669832912baR2152

Paul Karikh (pkarikh)
Changed in horizon:
assignee: nobody → Paul Karikh (pkarikh)
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/302925

Changed in horizon:
status: New → In Progress
Paul Karikh (pkarikh)
summary: - Disabled neutron quota break "Create subnet" button
+ Disabled neutron quota breaks "Create subnet" button
Timur Sufiev (tsufiev-x)
Changed in horizon:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Rob Cresswell (<email address hidden>) on branch: master
Review: https://review.openstack.org/302925
Reason: Abandoned due to inactivity. Feel free to restore if you wish to work on it

Changed in horizon:
status: In Progress → Incomplete
status: Incomplete → Triaged
Changed in horizon:
milestone: none → pike-1
Changed in horizon:
assignee: Paul Karikh (pkarikh) → Rob Cresswell (robcresswell)
status: Triaged → In Progress
Changed in horizon:
assignee: Rob Cresswell (robcresswell) → Akihiro Motoki (amotoki)
Changed in horizon:
milestone: pike-1 → pike-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/302925
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=8dc3e4324770bcc963cc213884861a563c2fd8e3
Submitter: Jenkins
Branch: master

commit 8dc3e4324770bcc963cc213884861a563c2fd8e3
Author: Paul Karikh <email address hidden>
Date: Thu Apr 7 19:04:36 2016 +0300

    Fix allowed() function for CreateSubnet

    If neutron quotas disabled, there is no usages['subnets']['available']
    So this check raises KeyError exception and makes "Create subnet"
    button dissapear.

    In addition, common codes in project.networks.tests related to
    this change are merged into a common method.

    Change-Id: I998c98c190fd4dc4039c7fb8ef7b1ef27bbeb863
    Closes-Bug: #1567529

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 12.0.0.0b2

This issue was fixed in the openstack/horizon 12.0.0.0b2 development milestone.

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.