diff options
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/views/servers.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/views/servers.py b/nova/api/openstack/compute/views/servers.py index f14773e98..b0c2fb2b2 100644 --- a/nova/api/openstack/compute/views/servers.py +++ b/nova/api/openstack/compute/views/servers.py @@ -179,7 +179,12 @@ class ViewBuilder(common.ViewBuilder): } def _get_flavor(self, request, instance): - flavor_id = instance["instance_type"]["flavorid"] + instance_type = instance["instance_type"] + if not instance_type: + LOG.warn(_("Instance has had its instance_type removed " + "from the DB"), instance=instance) + return {} + flavor_id = instance_type["flavorid"] flavor_bookmark = self._flavor_builder._get_bookmark_link(request, flavor_id, "flavors") |
