Cinder API v2 support instance view

Bug #1386727 reported by Heiko Krämer
58
This bug affects 9 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Heiko Krämer
Juno
Fix Released
Medium
Heiko Krämer

Bug Description

There was a bug report: https://bugs.launchpad.net/bugs/1226944 to fix Horizon to communicate with Cinder v2 API.

But there's a problem still exists for the instance view.

If you're using cinder v2 you will get an error for instance view:

https://github.com/openstack/horizon/blob/stable/juno/openstack_dashboard/api/nova.py#L720
https://github.com/openstack/horizon/blob/stable/icehouse/openstack_dashboard/api/nova.py#L668

=> should be
volume.name = volume_data.name

Reproduce:

* Add new cinder endpoint (API v2)
* Login to Horizon
* Create instance
* Show instance details => 500

[Tue Oct 28 12:26:29 2014] [error] Internal Server Error: /project/instances/cd38d21d-0281-40cf-b31b-c39f27f62ea8/
[Tue Oct 28 12:26:29 2014] [error] Traceback (most recent call last):
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
[Tue Oct 28 12:26:29 2014] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/decorators.py", line 38, in dec
[Tue Oct 28 12:26:29 2014] [error] return view_func(request, *args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/decorators.py", line 54, in dec
[Tue Oct 28 12:26:29 2014] [error] return view_func(request, *args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/decorators.py", line 38, in dec
[Tue Oct 28 12:26:29 2014] [error] return view_func(request, *args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 69, in view
[Tue Oct 28 12:26:29 2014] [error] return self.dispatch(request, *args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 87, in dispatch
[Tue Oct 28 12:26:29 2014] [error] return handler(request, *args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/tabs/views.py", line 71, in get
[Tue Oct 28 12:26:29 2014] [error] context = self.get_context_data(**kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/views.py", line 251, in get_context_data
[Tue Oct 28 12:26:29 2014] [error] context = super(DetailView, self).get_context_data(**kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/tabs/views.py", line 56, in get_context_data
[Tue Oct 28 12:26:29 2014] [error] exceptions.handle(self.request)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/tabs/views.py", line 51, in get_context_data
[Tue Oct 28 12:26:29 2014] [error] tab_group = self.get_tabs(self.request, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/views.py", line 287, in get_tabs
[Tue Oct 28 12:26:29 2014] [error] instance = self.get_data()
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/horizon/utils/memoized.py", line 90, in wrapped
[Tue Oct 28 12:26:29 2014] [error] value = cache[key] = func(*args, **kwargs)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/views.py", line 273, in get_data
[Tue Oct 28 12:26:29 2014] [error] redirect=redirect)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/views.py", line 261, in get_data
[Tue Oct 28 12:26:29 2014] [error] instance_id)
[Tue Oct 28 12:26:29 2014] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py", line 668, in instance_volumes_list
[Tue Oct 28 12:26:29 2014] [error] volume.name = volume_data.display_name
[Tue Oct 28 12:26:29 2014] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/base.py", line 271, in __getattr__
[Tue Oct 28 12:26:29 2014] [error] raise AttributeError(k)
[Tue Oct 28 12:26:29 2014] [error] AttributeError: display_name

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/131475

Changed in horizon:
assignee: nobody → Heiko Krämer (foexle)
status: New → In Progress
Changed in horizon:
status: In Progress → Confirmed
importance: Undecided → Medium
tags: added: volume
Changed in horizon:
status: Confirmed → In Progress
Julie Pichon (jpichon)
tags: added: icehouse-backport-potential juno-backport-potential
Changed in horizon:
assignee: Heiko Krämer (foexle) → Julie Pichon (jpichon)
Julie Pichon (jpichon)
Changed in horizon:
assignee: Julie Pichon (jpichon) → Heiko Krämer (foexle)
Changed in horizon:
assignee: Heiko Krämer (foexle) → Julie Pichon (jpichon)
Julie Pichon (jpichon)
Changed in horizon:
assignee: Julie Pichon (jpichon) → Heiko Krämer (foexle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit 9e5a4babf82258641a082d03673cb5ca329c65d1
Author: Heiko Krämer <email address hidden>
Date: Tue Oct 28 16:05:31 2014 +0100

    Fix Instance Details error when using Cinder V2

    If you're using cinder V2 API you will get an error for instance details view.
    The function 'instance_volumes_list' is called by the detail view of an instance
    and try to get from 'display_name'. Since Cinder v2 it's changed to 'name'.

    Change-Id: I20de0b8e6c263fc306e1475ddd40b4156e828bf1
    Closes-Bug: #1386727
    Related-Bug: #1226944
    Co-Authored-By: Julie Pichon <email address hidden>

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/135517

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

Reviewed: https://review.openstack.org/135517
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a2edb3d7100d903ae4846dbd0e197ad972dc458c
Submitter: Jenkins
Branch: stable/juno

commit a2edb3d7100d903ae4846dbd0e197ad972dc458c
Author: Heiko Krämer <email address hidden>
Date: Tue Oct 28 16:05:31 2014 +0100

    Fix Instance Details error when using Cinder V2

    If you're using cinder V2 API you will get an error for instance details view.
    The function 'instance_volumes_list' is called by the detail view of an instance
    and try to get from 'display_name'. Since Cinder v2 it's changed to 'name'.

    Change-Id: I20de0b8e6c263fc306e1475ddd40b4156e828bf1
    Closes-Bug: #1386727
    Related-Bug: #1226944
    Co-Authored-By: Julie Pichon <email address hidden>
    (cherry picked from commit 9e5a4babf82258641a082d03673cb5ca329c65d1)

tags: added: in-stable-juno
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → kilo-1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
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.