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
(cherry picked from commit 34b8336a41)
This commit is contained in:
Wenzhi Yu 2016-04-28 16:06:57 +08:00
parent 38d8b7ca7e
commit 168409fa93
1 changed files with 1 additions and 0 deletions

View File

@ -547,6 +547,7 @@ class ComputeAPI(object):
version = '4.2'
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,