Security group checking action permissions raise error

Bug #1422049 reported by qiaojian
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
qiaojian
Juno
Won't Fix
Undecided
Unassigned

Bug Description

When using nova-network, I got the output on horizon:

[Sun Feb 15 02:48:41.965163 2015] [:error] [pid 21259:tid 140656137611008] Error while checking action permissions.
[Sun Feb 15 02:48:41.965184 2015] [:error] [pid 21259:tid 140656137611008] Traceback (most recent call last):
[Sun Feb 15 02:48:41.965193 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/base.py", line 1260, in _filter_action
[Sun Feb 15 02:48:41.965199 2015] [:error] [pid 21259:tid 140656137611008] return action._allowed(request, datum) and row_matched
[Sun Feb 15 02:48:41.965205 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/actions.py", line 137, in _allowed
[Sun Feb 15 02:48:41.965211 2015] [:error] [pid 21259:tid 140656137611008] return self.allowed(request, datum)
[Sun Feb 15 02:48:41.965440 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py", line 83, in allowed
[Sun Feb 15 02:48:41.965457 2015] [:error] [pid 21259:tid 140656137611008] if usages['security_groups']['available'] <= 0:
[Sun Feb 15 02:48:41.965466 2015] [:error] [pid 21259:tid 140656137611008] KeyError: 'available'
[Sun Feb 15 02:48:41.986480 2015] [:error] [pid 21259:tid 140656137611008] Error while checking action permissions.
[Sun Feb 15 02:48:41.986533 2015] [:error] [pid 21259:tid 140656137611008] Traceback (most recent call last):
[Sun Feb 15 02:48:41.986569 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/base.py", line 1260, in _filter_action
[Sun Feb 15 02:48:41.986765 2015] [:error] [pid 21259:tid 140656137611008] return action._allowed(request, datum) and row_matched
[Sun Feb 15 02:48:41.986806 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/actions.py", line 137, in _allowed
[Sun Feb 15 02:48:41.986841 2015] [:error] [pid 21259:tid 140656137611008] return self.allowed(request, datum)
[Sun Feb 15 02:48:41.987010 2015] [:error] [pid 21259:tid 140656137611008] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py", line 83, in allowed
[Sun Feb 15 02:48:41.987051 2015] [:error] [pid 21259:tid 140656137611008] if usages['security_groups']['available'] <= 0:
[Sun Feb 15 02:48:41.987088 2015] [:error] [pid 21259:tid 140656137611008] KeyError: 'available'

qiaojian (qiaojian)
Changed in horizon:
assignee: nobody → qiaojian (qiaojian)
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/156017

Changed in horizon:
status: New → In Progress
Changed in horizon:
milestone: none → kilo-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit f2ed0e7d819af2158e2ea92f6f44cf3a57efbfc3
Author: qiaojian <email address hidden>
Date: Sun Feb 15 12:06:29 2015 +0800

    Fix security group checking action permissions raise error

    The security group usage did not contain key 'available'
    when using nova-network, so it must be checked before using.

    Change-Id: I1a4b78360ce84731449ca9416c36c552e35fe20b
    Closes-Bug: #1422049

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-rc1 → 2015.1.0
tags: added: juno-backport-potential
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Code is not in Juno, no need to backport

tags: removed: juno-backport-potential
Revision history for this message
Sam Morrison (sorrison) wrote :

I'm confused, the code isn't in Juno so then we do need to backport it?

tags: added: juno-backport-potential
Revision history for this message
Sam Morrison (sorrison) wrote :

Also the fix for this is wrong I think. The key "available" never exists so this will always use the default of 1. The correct way to fix this would be to count the number of security of the user

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.