From a20a275ef5cae1b38ead1c3191dd96a042eb2070 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 20 Nov 2020 20:57:28 +0900 Subject: [PATCH] Fix AttributeError in the project instance detail view The previous code does not handle a case where admin-specific attributes do not exist. This leads to AttributeError in the project instance detail page as these attributes are not included in the response from nova API. Change-Id: I4c2942960259782d47c6777394dec6888959e26c Closes-Bug: #1905024 --- openstack_dashboard/api/_nova.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack_dashboard/api/_nova.py b/openstack_dashboard/api/_nova.py index 93bd5a7a9f..4d237cc463 100644 --- a/openstack_dashboard/api/_nova.py +++ b/openstack_dashboard/api/_nova.py @@ -84,7 +84,7 @@ class Server(base.APIResourceWrapper): @property def has_extended_attrs(self): - return any(getattr(self, attr) for attr in [ + return any(getattr(self, attr, None) for attr in [ 'OS-EXT-SRV-ATTR:instance_name', 'OS-EXT-SRV-ATTR:host', 'OS-EXT-SRV-ATTR:hostname', 'OS-EXT-SRV-ATTR:kernel_id', 'OS-EXT-SRV-ATTR:ramdisk_id', 'OS-EXT-SRV-ATTR:root_device_name',