Merge "Don't persist RequestSpec.requested_destination"
This commit is contained in:
commit
b7bc5465fd
@ -558,9 +558,11 @@ class RequestSpec(base.NovaObject):
|
|||||||
if 'instance_group' in spec and spec.instance_group:
|
if 'instance_group' in spec and spec.instance_group:
|
||||||
spec.instance_group.members = None
|
spec.instance_group.members = None
|
||||||
spec.instance_group.hosts = None
|
spec.instance_group.hosts = None
|
||||||
# NOTE(mriedem): Don't persist retries since those are per-request
|
# NOTE(mriedem): Don't persist retries or requested_destination
|
||||||
if 'retry' in spec and spec.retry:
|
# since those are per-request
|
||||||
spec.retry = None
|
for excluded in ('retry', 'requested_destination'):
|
||||||
|
if excluded in spec and getattr(spec, excluded):
|
||||||
|
setattr(spec, excluded, None)
|
||||||
# NOTE(stephenfin): Don't persist network metadata since we have
|
# NOTE(stephenfin): Don't persist network metadata since we have
|
||||||
# no need for it after scheduling
|
# no need for it after scheduling
|
||||||
if 'network_metadata' in spec and spec.network_metadata:
|
if 'network_metadata' in spec and spec.network_metadata:
|
||||||
|
@ -92,8 +92,6 @@ class ColdMigrateTargetHostThenLiveMigrateTest(
|
|||||||
'os-migrateLive': {'host': None, 'block_migration': 'auto'}}
|
'os-migrateLive': {'host': None, 'block_migration': 'auto'}}
|
||||||
self.admin_api.post_server_action(server['id'], live_migrate_req)
|
self.admin_api.post_server_action(server['id'], live_migrate_req)
|
||||||
server = self._wait_for_state_change(self.admin_api, server, 'ACTIVE')
|
server = self._wait_for_state_change(self.admin_api, server, 'ACTIVE')
|
||||||
|
# The live migration should have been successful and the server is now
|
||||||
# FIXME(mriedem): Until bug 1797580 is resolved the migration will
|
# back on the original host.
|
||||||
# fail during scheduling.
|
self.assertEqual(original_host, server['OS-EXT-SRV-ATTR:host'])
|
||||||
migration = self._wait_for_migration_status(server, ['error'])
|
|
||||||
self.assertEqual('live-migration', migration['migration_type'])
|
|
||||||
|
@ -594,6 +594,7 @@ class _TestRequestSpecObject(object):
|
|||||||
self.assertIsNone(serialized_obj.instance_group.members)
|
self.assertIsNone(serialized_obj.instance_group.members)
|
||||||
self.assertIsNone(serialized_obj.instance_group.hosts)
|
self.assertIsNone(serialized_obj.instance_group.hosts)
|
||||||
self.assertIsNone(serialized_obj.retry)
|
self.assertIsNone(serialized_obj.retry)
|
||||||
|
self.assertIsNone(serialized_obj.requested_destination)
|
||||||
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
req_obj = fake_request_spec.fake_spec_obj(remove_id=True)
|
req_obj = fake_request_spec.fake_spec_obj(remove_id=True)
|
||||||
@ -616,6 +617,9 @@ class _TestRequestSpecObject(object):
|
|||||||
|
|
||||||
def test_save(self):
|
def test_save(self):
|
||||||
req_obj = fake_request_spec.fake_spec_obj()
|
req_obj = fake_request_spec.fake_spec_obj()
|
||||||
|
# Make sure the requested_destination is not persisted since it is
|
||||||
|
# only valid per request/operation.
|
||||||
|
req_obj.requested_destination = objects.Destination(host='fake')
|
||||||
|
|
||||||
def _test_save_args(self2, context, instance_uuid, changes):
|
def _test_save_args(self2, context, instance_uuid, changes):
|
||||||
self._check_update_primitive(req_obj, changes)
|
self._check_update_primitive(req_obj, changes)
|
||||||
|
Loading…
Reference in New Issue
Block a user