Deprecate conductor migration_get()

It's no longer used.  Deprecate it.

Related to blueprint unified-object-model

Change-Id: Ib7be13c53231220eec232442cb1836626b4b580f
This commit is contained in:
Chris Behrens 2013-08-21 11:33:11 +00:00
parent ca4a048ca1
commit 94a860a10e
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

@ -77,7 +77,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',
@ -161,6 +161,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

@ -127,14 +127,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')
@ -582,6 +574,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')