From 64499a730d215c60e36d5d8438b15770755c22e3 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Mon, 8 Feb 2016 08:39:50 +0100 Subject: [PATCH] Protect cinder list against permission issues When listing all cinder volumes the user may not have permissions to see the volume transfers. This patch makes it so the call to transfer_list is protected against Forbiden errir so the user can still see the volume list. Change-Id: I575ffebcd5084165e72f6e100ed43b4d3f358e98 Closes-Bug: #1541094 --- openstack_dashboard/api/cinder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/api/cinder.py b/openstack_dashboard/api/cinder.py index 2c5ca36b8..a2bb4ef9e 100644 --- a/openstack_dashboard/api/cinder.py +++ b/openstack_dashboard/api/cinder.py @@ -682,8 +682,12 @@ def transfer_list(request, detailed=True, search_opts=None): search option: {'all_tenants': 1} """ c_client = cinderclient(request) - return [VolumeTransfer(v) for v in c_client.transfers.list( - detailed=detailed, search_opts=search_opts)] + try: + return [VolumeTransfer(v) for v in c_client.transfers.list( + detailed=detailed, search_opts=search_opts)] + except cinder_exception.Forbidden as error: + LOG.error(error) + return [] def transfer_get(request, transfer_id):