Make compute rpcapi 'live_migration' backward compatible
This commit[1] added compute rpcapi version 4.2 which introduced a new
argument 'migration' when calling 'live_migration' method, but the code
did not ensure the backward compatibility with older version compute
node.
When calling 'live_migration' method with 'migration' argument on older
version(like Kilo) of nova compute node, a "TypeError: live_migration()
got an unexpected keyword argument 'migration'" will be threw up.
[1]2f4e64a7cf
Change-Id: Ie5c498d34e7c4c6573d611abd592c25f1bcb4f44
Closes-Bug: #1576048
This commit is contained in:
parent
b256cae8e2
commit
34b8336a41
|
@ -628,6 +628,7 @@ class ComputeAPI(object):
|
|||
pre_migration_result=True)
|
||||
if not self.client.can_send_version(version):
|
||||
version = '4.0'
|
||||
args.pop('migration')
|
||||
cctxt = self.client.prepare(server=host, version=version)
|
||||
cctxt.cast(ctxt, 'live_migration', instance=instance,
|
||||
dest=dest, block_migration=block_migration,
|
||||
|
|
|
@ -620,7 +620,6 @@ class ComputeRpcAPITestCase(test.NoDBTestCase):
|
|||
callargs={'instance': 'foo',
|
||||
'dest': 'foo',
|
||||
'block_migration': False,
|
||||
'migration': None,
|
||||
'migrate_data': {
|
||||
'pre_live_migration_result': {}}},
|
||||
callret=None,
|
||||
|
|
Loading…
Reference in New Issue