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 <jpichon@redhat.com>
This commit is contained in:
parent
162c87a67a
commit
9e5a4babf8
|
@ -717,13 +717,13 @@ def instance_volume_detach(request, instance_id, att_id):
|
|||
|
||||
|
||||
def instance_volumes_list(request, instance_id):
|
||||
from openstack_dashboard.api.cinder import cinderclient # noqa
|
||||
from openstack_dashboard.api import cinder
|
||||
|
||||
volumes = novaclient(request).volumes.get_server_volumes(instance_id)
|
||||
|
||||
for volume in volumes:
|
||||
volume_data = cinderclient(request).volumes.get(volume.id)
|
||||
volume.name = volume_data.display_name
|
||||
volume_data = cinder.cinderclient(request).volumes.get(volume.id)
|
||||
volume.name = cinder.Volume(volume_data).name
|
||||
|
||||
return volumes
|
||||
|
||||
|
|
Loading…
Reference in New Issue