Prevent an array index exception if server does not have an image.
Change-Id: I63d3a92cea4da042942540b0800b5c4e825983c5 Fixes: bug #1202784
This commit is contained in:
parent
8914ed95fc
commit
ef8ca80344
@ -85,6 +85,8 @@ class Server(APIResourceWrapper):
|
||||
def image_name(self):
|
||||
import glanceclient.exc as glance_exceptions
|
||||
from openstack_dashboard.api import glance
|
||||
if not self.image:
|
||||
return "(not found)"
|
||||
try:
|
||||
image = glance.image_get(self.request, self.image['id'])
|
||||
return image.name
|
||||
|
Loading…
x
Reference in New Issue
Block a user