Merge "Metadata service: remove check for the instance object type"

This commit is contained in:
Jenkins 2015-01-06 10:04:46 +00:00 committed by Gerrit Code Review
commit 3ae2ddd4a2
2 changed files with 0 additions and 14 deletions

View File

@ -112,15 +112,6 @@ class InstanceMetadata():
ctxt = context.get_admin_context()
# NOTE(danms): This should be removed after bp:compute-manager-objects
if not isinstance(instance, obj_base.NovaObject):
expected = ['metadata', 'system_metadata']
if 'info_cache' in instance:
expected.append('info_cache')
instance = objects.Instance._from_db_object(
ctxt, objects.Instance(), instance,
expected_attrs=expected)
# The default value of mimeType is set to MIME_TYPE_TEXT_PLAIN
self.set_mimetype(MIME_TYPE_TEXT_PLAIN)
self.instance = instance

View File

@ -357,11 +357,6 @@ class OpenStackMetadataTestCase(test.TestCase):
self.flags(use_local=True, group='conductor')
fake_network.stub_out_nw_api_get_instance_nw_info(self.stubs)
def test_with_primitive_instance(self):
mdinst = fake_InstanceMetadata(self.stubs, INSTANCE)
result = mdinst.lookup('/openstack')
self.assertIn('latest', result)
def test_top_level_listing(self):
# request for /openstack/<version>/ should show metadata.json
inst = self.instance.obj_clone()