Merge "Don't throw 500 when image is missing"
This commit is contained in:
commit
9032be8a5a
@ -14,6 +14,7 @@ import logging
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from glanceclient import exc as glance_exceptions
|
||||
from openstack_dashboard.api import base
|
||||
from openstack_dashboard.api import glance
|
||||
from tuskarclient import client as tuskar_client
|
||||
@ -324,7 +325,11 @@ class Role(base.APIResourceWrapper):
|
||||
def image(self, plan):
|
||||
image_id = plan.parameter_value(self.image_id_parameter_name)
|
||||
if image_id:
|
||||
return glance.image_get(self._request, image_id)
|
||||
try:
|
||||
return glance.image_get(self._request, image_id)
|
||||
except glance_exceptions.HTTPNotFound:
|
||||
LOG.error("Couldn't obtain image with id %s" % image_id)
|
||||
return None
|
||||
|
||||
def flavor(self, plan):
|
||||
flavor_name = plan.parameter_value(
|
||||
|
Loading…
x
Reference in New Issue
Block a user