From 3013b48f32eb67f5eb00ef5a55bb557da6868ea9 Mon Sep 17 00:00:00 2001 From: "zhu.rong" Date: Tue, 15 Dec 2015 16:40:08 +0800 Subject: [PATCH] Fix volumes no attribute tenant_name error Fix the volumes have no attribute tenant_name error, when the volumes are in the creating/deleting/attaching status. Closes-Bug: #1526199 Change-Id: I0085969bb8981e4ab50e4e45dbcddda19b95b6b7 --- openstack_dashboard/dashboards/admin/volumes/volumes/tables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/admin/volumes/volumes/tables.py b/openstack_dashboard/dashboards/admin/volumes/volumes/tables.py index 4faf45f86d..9767699405 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volumes/tables.py +++ b/openstack_dashboard/dashboards/admin/volumes/volumes/tables.py @@ -91,7 +91,8 @@ class VolumesTable(volumes_tables.VolumesTable): verbose_name=_("Name"), link="horizon:admin:volumes:volumes:detail") host = tables.Column("os-vol-host-attr:host", verbose_name=_("Host")) - tenant = tables.Column("tenant_name", verbose_name=_("Project")) + tenant = tables.Column(lambda obj: getattr(obj, 'tenant_name', None), + verbose_name=_("Project")) class Meta(object): name = "volumes"