Remove uses of instance['instance_type'] from nova/notifications

This is one change in a series aimed at removing the use of instance-linked
instance_type objects, in favor of the decoupled type data in
system_metadata. See bug 1140119 for more details.

Change-Id: Iebbb0fa0bf306d6a7c8b83594e13a4b99f27c404
This commit is contained in:
Dan Smith
2013-03-08 13:45:45 -05:00
committed by Gerrit Code Review
parent 666ffe34ac
commit bd5a9b87a7
3 changed files with 11 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ the system.
from oslo.config import cfg
from nova.compute import instance_types
import nova.context
from nova import db
from nova.image import glance
@@ -283,7 +284,8 @@ def info_from_instance(context, instance_ref, network_info,
image_ref_url = glance.generate_image_url(instance_ref['image_ref'])
instance_type_name = instance_ref.get('instance_type', {}).get('name', '')
instance_type = instance_types.extract_instance_type(instance_ref)
instance_type_name = instance_type.get('name', '')
if system_metadata is None:
system_metadata = utils.metadata_to_dict(