pure project admin can't view projects

Bug #1587951 reported by Ryan Peters
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Ryan Peters

Bug Description

With Domains enabled, if you create a Project, with a user who is an admin on that project (but not a domain admin), the Identity > Projects panel will return a 500 error:

Pure project admin doesn't have a domain token
Internal Server Error: /identity/
Traceback (most recent call last):
  File "/Users/rpeters/openstack/horizon/.venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/rpeters/openstack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/rpeters/openstack/horizon/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/rpeters/openstack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/rpeters/openstack/horizon/.venv/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/rpeters/openstack/horizon/.venv/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/rpeters/openstack/horizon/horizon/tables/views.py", line 215, in get
    handled = self.construct_tables()
  File "/Users/rpeters/openstack/horizon/horizon/tables/views.py", line 206, in construct_tables
    handled = self.handle_table(table)
  File "/Users/rpeters/openstack/horizon/horizon/tables/views.py", line 121, in handle_table
    data = self._get_data_dict()
  File "/Users/rpeters/openstack/horizon/horizon/tables/views.py", line 243, in _get_data_dict
    self._data = {self.table_class._meta.name: self.get_data()}
  File "/Users/rpeters/openstack/horizon/openstack_dashboard/dashboards/identity/projects/views.py", line 115, in get_data
    t.domain_name = domain_lookup.get(t.domain_id)
AttributeError: 'NoneType' object has no attribute 'get'
[01/Jun/2016 15:10:37] "GET /identity/ HTTP/1.1" 500 324035

This is due to this section of code in openstack_dashboard/dashboards/identity/projects/views.py returning None for domain_lookup, making the .get() grumpy.

if api.keystone.VERSIONS.active >= 3:
    domain_lookup = api.keystone.domain_lookup(self.request)
        for t in tenants:
            t.domain_name = domain_lookup.get(t.domain_id)
return tenants

Ryan Peters (rjpeter2)
Changed in horizon:
assignee: nobody → Ryan Peters (rjpeter2)
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/323986

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

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

commit 6e555e8aaf46d1798de8d0ab1135e9e9e141a5a4
Author: Ryan Peters <email address hidden>
Date: Wed Jun 1 10:29:44 2016 -0500

    Pure project admin can't view Projects page

    With Domains enabled, if you create a Project, with a user
    who is an admin on that project (but not a domain admin),
    the Identity > Projects panel will return a 500 error.

    Change-Id: I6e3bf7ab8deb86a7f051e3600a6e99ce36a4fe9f
    Closes-bug: #1587951

Changed in horizon:
status: In Progress → Fix Released
Changed in horizon:
importance: Undecided → High
milestone: none → newton-2
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b2

This issue was fixed in the openstack/horizon 10.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.