diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-06-27 20:33:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-06-27 20:33:21 +0000 |
| commit | c62ce3f98f2c40bd82b9b5b2cec03f3d15ad4766 (patch) | |
| tree | 52149c90c5498fab3c0d96dff4625a3f58f37ee1 /nova/api | |
| parent | 7aa8fdae6ec72aaf03fca25398776b9b97beddf9 (diff) | |
| parent | fada5d801c699da16e8e600d474a1da94fb7f4d2 (diff) | |
| download | nova-c62ce3f98f2c40bd82b9b5b2cec03f3d15ad4766.tar.gz nova-c62ce3f98f2c40bd82b9b5b2cec03f3d15ad4766.tar.xz nova-c62ce3f98f2c40bd82b9b5b2cec03f3d15ad4766.zip | |
Merge "Make nova list/show behave nicely on instance_type deletion"
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") |
