[dashboard] Invalid error handle when non-admin user tries to mark pre-installed image

Bug #1423841 reported by Ekaterina Chernova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Low
Ekaterina Chernova

Bug Description

Steps to reproduce:
1. Log in Horizon
2. Create new project and non-admin user in it
3. Navigate to Murano > Manage > Images
4. Click on 'Mark Image'
5. Fill the form and click on 'Mark'

Observed result:
Following error message: Danger: There was an error submitting the form. Please try again.
and errors in var/log/dashboard.log
<139>Feb 19 13:41:59 node-2 dashboard-django.request: ERROR Internal Server Error: /dashboard/murano/images/mark_image
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 84, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/django/views/generic/base.py", line 86, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/django/views/generic/edit.py", line 165, in post
    return self.form_valid(form)
  File "/usr/lib/python2.6/site-packages/horizon/forms/views.py", line 118, in form_valid
    exceptions.handle(self.request)
  File "/usr/lib/python2.6/site-packages/horizon/exceptions.py", line 334, in handle
    six.reraise(exc_type, exc_value, exc_traceback)
  File "/usr/lib/python2.6/site-packages/horizon/forms/views.py", line 115, in form_valid
    handled = form.handle(self.request, form.cleaned_data)
  File "/usr/lib/python2.6/site-packages/muranodashboard/images/forms.py", line 93, in handle
    redirect='horizon:murano:images:index')
  File "/usr/lib/python2.6/site-packages/horizon/exceptions.py", line 334, in handle
    six.reraise(exc_type, exc_value, exc_traceback)
  File "/usr/lib/python2.6/site-packages/muranodashboard/images/forms.py", line 88, in handle
    img = glance.image_update(request, image_id, properties=properties)
  File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/glance.py", line 123, in image_update
    return image
UnboundLocalError: local variable 'image' referenced before assignment

Changed in murano:
importance: Undecided → Low
status: New → In Progress
assignee: nobody → Ekaterina Chernova (efedorova)
milestone: none → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano-dashboard (master)

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

summary: - [dashboard] nvalid error handle when non-admin user tries to mark pre-
+ [dashboard] Invalid error handle when non-admin user tries to mark pre-
installed image
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano-dashboard (master)

Reviewed: https://review.openstack.org/157699
Committed: https://git.openstack.org/cgit/stackforge/murano-dashboard/commit/?id=0bd82dcd370827b2f205753dc62c23556241ff5f
Submitter: Jenkins
Branch: master

commit 0bd82dcd370827b2f205753dc62c23556241ff5f
Author: Ekaterina Chernova <email address hidden>
Date: Fri Feb 20 12:04:13 2015 +0300

    Do not allow image management for non-admins

    Non-admin users are not allowwed to change glance metadata, so we should hide
    all buttons, that target that action.

    The whole panel was not hide, since user should be informed this all images,
    avaliable in Murano.

    Change-Id: Ib86262449c07682ece0e3990c47112d80390271d
    Closes-Bug: #1423841

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: kilo-3 → 2015.1.0
tags: added: juno-backport-potential
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.