Merge "Revert "Make server_groups determine deleted-ness from InstanceMappingList""
This commit is contained in:
commit
1106477b78
|
@ -59,9 +59,10 @@ class ServerGroupController(wsgi.Controller):
|
|||
members = []
|
||||
if group.members:
|
||||
# Display the instances that are not deleted.
|
||||
mappings = objects.InstanceMappingList.get_by_instance_uuids(
|
||||
context, group.members)
|
||||
members = [mapping.instance_uuid for mapping in mappings]
|
||||
filters = {'uuid': group.members, 'deleted': False}
|
||||
instances = objects.InstanceList.get_by_filters(
|
||||
context, filters=filters)
|
||||
members = [instance.uuid for instance in instances]
|
||||
server_group['members'] = members
|
||||
# Add project id information to the response data for
|
||||
# API version v2.13
|
||||
|
|
|
@ -146,11 +146,6 @@ class ServerGroupTestV21(test.TestCase):
|
|||
vm_state='fake',
|
||||
system_metadata={'key': 'value'})
|
||||
instance.create()
|
||||
im = objects.InstanceMapping(context=context,
|
||||
project_id=context.project_id,
|
||||
user_id=context.user_id,
|
||||
instance_uuid=instance.uuid)
|
||||
im.create()
|
||||
return instance
|
||||
|
||||
def _create_instance_group(self, context, members):
|
||||
|
@ -310,8 +305,6 @@ class ServerGroupTestV21(test.TestCase):
|
|||
|
||||
# delete an instance
|
||||
instances[1].destroy()
|
||||
objects.InstanceMapping.get_by_instance_uuid(
|
||||
ctx, instances[1].uuid).destroy()
|
||||
# check that the instance does not exist
|
||||
self.assertRaises(exception.InstanceNotFound,
|
||||
objects.Instance.get_by_uuid,
|
||||
|
|
Loading…
Reference in New Issue