Merge "Deprecate instance_fault_create() from conductor"

This commit is contained in:
Jenkins
2014-05-03 00:25:47 +00:00
committed by Gerrit Code Review
4 changed files with 11 additions and 16 deletions

View File

@@ -81,9 +81,6 @@ class LocalAPI(object):
def instance_info_cache_delete(self, context, instance):
return self._manager.instance_info_cache_delete(context, instance)
def instance_fault_create(self, context, values):
return self._manager.instance_fault_create(context, values)
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

@@ -964,6 +964,7 @@ class _ConductorManagerV2Proxy(object):
return self.manager.instance_get_all_by_host(context, host, node,
columns_to_join)
# TODO(danms): This can be removed in version 3.0 of the RPC API
def instance_fault_create(self, context, values):
return self.manager.instance_fault_create(context, values)

View File

@@ -145,6 +145,7 @@ class ConductorAPI(object):
... - Remove compute_unrescue()
... - Remove instance_get_all_by_filters()
... - Remove instance_get_active_by_window_joined()
... - Remove instance_fault_create()
"""
VERSION_ALIASES = {
@@ -263,10 +264,6 @@ class ConductorAPI(object):
host=host, node=node,
columns_to_join=columns_to_join)
def instance_fault_create(self, context, values):
cctxt = self.client.prepare()
return cctxt.call(context, 'instance_fault_create', values=values)
def action_event_start(self, context, values):
values_p = jsonutils.to_primitive(values)
cctxt = self.client.prepare()

View File

@@ -296,15 +296,6 @@ class _BaseTestCase(object):
result = self.conductor.compute_node_delete(self.context, node)
self.assertIsNone(result)
def test_instance_fault_create(self):
self.mox.StubOutWithMock(db, 'instance_fault_create')
db.instance_fault_create(self.context, 'fake-values').AndReturn(
'fake-result')
self.mox.ReplayAll()
result = self.conductor.instance_fault_create(self.context,
'fake-values')
self.assertEqual(result, 'fake-result')
def test_task_log_get(self):
self.mox.StubOutWithMock(db, 'task_log_get')
db.task_log_get(self.context, 'task', 'begin', 'end', 'host',
@@ -918,6 +909,15 @@ class ConductorTestCase(_BaseTestCase, test.TestCase):
self.conductor.instance_get_active_by_window_joined(
self.context, 'fake-begin', 'fake-end', 'fake-proj', 'fake-host')
def test_instance_fault_create(self):
self.mox.StubOutWithMock(db, 'instance_fault_create')
db.instance_fault_create(self.context, 'fake-values').AndReturn(
'fake-result')
self.mox.ReplayAll()
result = self.conductor.instance_fault_create(self.context,
'fake-values')
self.assertEqual(result, 'fake-result')
class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):
"""Conductor RPC API Tests."""