Remove unused instance_update() method from virtapi

This removes the now-unused instance_update() method from the VirtAPI.

Related to blueprint virt-objects-juno

Change-Id: Iaa55e7156244c9cdf7558e23ecab49db162daa37
This commit is contained in:
Dan Smith 2014-05-06 11:32:16 -07:00
parent 5ad4bb9c97
commit e44e2145df
5 changed files with 2 additions and 39 deletions

View File

@ -500,11 +500,6 @@ class ComputeVirtAPI(virtapi.VirtAPI):
super(ComputeVirtAPI, self).__init__()
self._compute = compute
def instance_update(self, context, instance_uuid, updates):
return self._compute._instance_update(context,
instance_uuid,
**updates)
def provider_fw_rule_get_all(self, context):
return self._compute.conductor_api.provider_fw_rule_get_all(context)

View File

@ -42,10 +42,6 @@ class VirtAPIBaseTest(test.NoDBTestCase, test.APICoverage):
getattr(self.virtapi, method), self.context,
*args, **kwargs)
def test_instance_update(self):
self.assertExpected('instance_update', 'fake-uuid',
dict(host='foohost'))
def test_provider_fw_rule_get_all(self):
self.assertExpected('provider_fw_rule_get_all')
@ -73,13 +69,7 @@ class FakeVirtAPITest(VirtAPIBaseTest):
self.assertTrue(run)
return
if method == 'instance_update':
# NOTE(danms): instance_update actually becomes the other variant
# in FakeVirtAPI
db_method = 'instance_update_and_get_original'
else:
db_method = method
self.mox.StubOutWithMock(db, db_method)
self.mox.StubOutWithMock(db, method)
if method in ('aggregate_metadata_add', 'aggregate_metadata_delete',
'security_group_rule_get_by_security_group'):
@ -91,7 +81,7 @@ class FakeVirtAPITest(VirtAPIBaseTest):
else:
e_args = args
getattr(db, db_method)(self.context, *e_args, **kwargs).AndReturn(
getattr(db, method)(self.context, *e_args, **kwargs).AndReturn(
'it worked')
self.mox.ReplayAll()
result = getattr(self.virtapi, method)(self.context, *args, **kwargs)
@ -107,11 +97,6 @@ class FakeCompute(object):
self.instance_events.prepare_for_instance_event.side_effect = \
self._prepare_for_instance_event
def _instance_update(self, context, instance_uuid, **kwargs):
# NOTE(danms): Fake this behavior from compute/manager::ComputeManager
return self.conductor_api.instance_update(context,
instance_uuid, kwargs)
def _event_waiter(self):
event = mock.MagicMock()
event.status = 'completed'

View File

@ -320,8 +320,6 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False)
self.conn._session.is_local_connection = False
self.stubs.Set(fake.FakeVirtAPI, 'instance_update',
lambda *args, **kwargs: ('fake-oldref', 'fake-newref'))
fake_image.stub_out_image_service(self.stubs)
set_image_fixtures()
stubs.stubout_image_service_download(self.stubs)

View File

@ -469,11 +469,6 @@ class FakeDriver(driver.ComputeDriver):
class FakeVirtAPI(virtapi.VirtAPI):
def instance_update(self, context, instance_uuid, updates):
return db.instance_update_and_get_original(context,
instance_uuid,
updates)
def provider_fw_rule_get_all(self, context):
return db.provider_fw_rule_get_all(context)

View File

@ -16,16 +16,6 @@ import contextlib
class VirtAPI(object):
def instance_update(self, context, instance_uuid, updates):
"""Perform an instance update operation on behalf of a virt driver
:param context: security context
:param instance_uuid: uuid of the instance to be updated
:param updates: dict of attribute=value pairs to change
Returns: orig_instance, new_instance
"""
raise NotImplementedError()
def provider_fw_rule_get_all(self, context):
"""Get the provider firewall rules
:param context: security context