Merge "Fix Cells RPC API by accepting a RequestSpec arg"
This commit is contained in:
commit
3087672083
nova
@ -571,7 +571,12 @@ class CellsAPI(object):
|
||||
cctxt.cast(ctxt, 'resize_instance', **msg_args)
|
||||
|
||||
def live_migrate_instance(self, ctxt, instance, host_name,
|
||||
block_migration, disk_over_commit):
|
||||
block_migration, disk_over_commit,
|
||||
request_spec=None):
|
||||
# NOTE(sbauza): Since Cells v1 is quite feature-freeze, we don't want
|
||||
# to pass down request_spec to the manager and rather keep the
|
||||
# cell conductor providing a new RequestSpec like the original
|
||||
# behaviour
|
||||
cctxt = self.client.prepare(version='1.20')
|
||||
cctxt.cast(ctxt, 'live_migrate_instance',
|
||||
instance=instance,
|
||||
@ -620,7 +625,12 @@ class CellsAPI(object):
|
||||
def rebuild_instance(self, ctxt, instance, new_pass, injected_files,
|
||||
image_ref, orig_image_ref, orig_sys_metadata, bdms,
|
||||
recreate=False, on_shared_storage=False, host=None,
|
||||
preserve_ephemeral=False, kwargs=None):
|
||||
preserve_ephemeral=False, request_spec=None,
|
||||
kwargs=None):
|
||||
# NOTE(sbauza): Since Cells v1 is quite feature-freeze, we don't want
|
||||
# to pass down request_spec to the manager and rather keep the
|
||||
# cell conductor providing a new RequestSpec like the original
|
||||
# behaviour
|
||||
cctxt = self.client.prepare(version='1.25')
|
||||
cctxt.cast(ctxt, 'rebuild_instance',
|
||||
instance=instance, image_href=image_ref,
|
||||
|
@ -681,6 +681,48 @@ class CellsAPITestCase(test.NoDBTestCase):
|
||||
self._check_result(call_info, 'live_migrate_instance',
|
||||
expected_args, version='1.20')
|
||||
|
||||
def test_live_migrate_instance_not_passing_request_spec(self):
|
||||
call_info = self._stub_rpc_method('cast', None)
|
||||
|
||||
self.cells_rpcapi.live_migrate_instance(self.fake_context,
|
||||
'fake-instance',
|
||||
'fake-host',
|
||||
'fake-block',
|
||||
'fake-commit',
|
||||
'fake-spec')
|
||||
expected_args = {'instance': 'fake-instance',
|
||||
'block_migration': 'fake-block',
|
||||
'disk_over_commit': 'fake-commit',
|
||||
'host_name': 'fake-host'}
|
||||
self._check_result(call_info, 'live_migrate_instance',
|
||||
expected_args, version='1.20')
|
||||
|
||||
def test_rebuild_instance_not_passing_request_spec(self):
|
||||
call_info = self._stub_rpc_method('cast', None)
|
||||
|
||||
self.cells_rpcapi.rebuild_instance(self.fake_context,
|
||||
'fake-instance',
|
||||
'fake-pass',
|
||||
'fake-files',
|
||||
'fake-image_ref',
|
||||
'fake-orig_image_ref',
|
||||
'fake-orig_sys_metadata',
|
||||
'fake-bdms',
|
||||
recreate=False,
|
||||
on_shared_storage=False,
|
||||
host=None,
|
||||
preserve_ephemeral=False,
|
||||
request_spec='fake-spec',
|
||||
kwargs=None)
|
||||
expected_args = {'instance': 'fake-instance',
|
||||
'image_href': 'fake-image_ref',
|
||||
'admin_password': 'fake-pass',
|
||||
'files_to_inject': 'fake-files',
|
||||
'preserve_ephemeral': False,
|
||||
'kwargs': None}
|
||||
self._check_result(call_info, 'rebuild_instance',
|
||||
expected_args, version='1.25')
|
||||
|
||||
def test_revert_resize(self):
|
||||
call_info = self._stub_rpc_method('cast', None)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user