Merge "Deprecate conductor migration_get()"

This commit is contained in:
Jenkins 2013-09-05 13:12:54 +00:00 committed by Gerrit Code Review
commit b4802fd0cb
4 changed files with 12 additions and 16 deletions

View File

@ -110,9 +110,6 @@ class LocalAPI(object):
def instance_fault_create(self, context, values):
return self._manager.instance_fault_create(context, values)
def migration_get(self, context, migration_id):
return self._manager.migration_get(context, migration_id)
def migration_get_in_progress_by_host_and_node(self, context, host, node):
return self._manager.migration_get_in_progress_by_host_and_node(
context, host, node)

View File

@ -76,7 +76,7 @@ class ConductorManager(manager.Manager):
namespace. See the ComputeTaskManager class for details.
"""
RPC_API_VERSION = '1.57'
RPC_API_VERSION = '1.58'
def __init__(self, *args, **kwargs):
super(ConductorManager, self).__init__(service_name='conductor',
@ -160,6 +160,8 @@ class ConductorManager(manager.Manager):
columns_to_join)
return jsonutils.to_primitive(result)
# NOTE(comstud): This method is now deprecated and can be removed in
# version v2.0 of the RPC API
@rpc_common.client_exceptions(exception.MigrationNotFound)
def migration_get(self, context, migration_id):
migration_ref = self.db.migration_get(context.elevated(),

View File

@ -109,6 +109,7 @@ class ConductorAPI(rpcclient.RpcProxy):
1.56 - Remove compute_confirm_resize and
migration_get_unconfirmed_by_dest_compute
1.57 - Remove migration_create()
1.58 - Remove migration_get()
"""
BASE_RPC_API_VERSION = '1.0'
@ -152,10 +153,6 @@ class ConductorAPI(rpcclient.RpcProxy):
cctxt = self.client.prepare(version=version)
return cctxt.call(context, 'instance_get_by_uuid', **kwargs)
def migration_get(self, context, migration_id):
cctxt = self.client.prepare(version='1.4')
return cctxt.call(context, 'migration_get', migration_id=migration_id)
def migration_get_in_progress_by_host_and_node(self, context,
host, node):
cctxt = self.client.prepare(version='1.31')

View File

@ -125,14 +125,6 @@ class _BaseTestCase(object):
self.assertRaises(KeyError,
self._do_update, 'any-uuid', foobar=1)
def test_migration_get(self):
migration = db.migration_create(self.context.elevated(),
{'instance_uuid': 'fake-uuid',
'status': 'migrating'})
self.assertEqual(jsonutils.to_primitive(migration),
self.conductor.migration_get(self.context,
migration['id']))
def test_migration_get_in_progress_by_host_and_node(self):
self.mox.StubOutWithMock(db,
'migration_get_in_progress_by_host_and_node')
@ -585,6 +577,14 @@ class ConductorTestCase(_BaseTestCase, test.TestCase):
self.conductor = conductor_manager.ConductorManager()
self.conductor_manager = self.conductor
def test_migration_get(self):
migration = db.migration_create(self.context.elevated(),
{'instance_uuid': 'fake-uuid',
'status': 'migrating'})
self.assertEqual(jsonutils.to_primitive(migration),
self.conductor.migration_get(self.context,
migration['id']))
def test_migration_get_unconfirmed_by_dest_compute(self):
self.mox.StubOutWithMock(db,
'migration_get_unconfirmed_by_dest_compute')