Deprecate and remove agent_build_get_by_triple()
This method was only used in the xenapi driver, which has since been converted to use Objects. This removes the call from VirtAPI, the conductor API, and deprecates it from conductor manager. Related to blueprint compute-manager-objects-juno Change-Id: I43b8c4bc201361ce79d56cac91a8944d18c03ab2
This commit is contained in:
parent
b93f353d7c
commit
4baff73773
|
@ -497,10 +497,6 @@ class ComputeVirtAPI(virtapi.VirtAPI):
|
|||
def provider_fw_rule_get_all(self, context):
|
||||
return self._compute.conductor_api.provider_fw_rule_get_all(context)
|
||||
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
return self._compute.conductor_api.agent_build_get_by_triple(
|
||||
context, hypervisor, os, architecture)
|
||||
|
||||
def _default_error_callback(self, event_name, instance):
|
||||
raise exception.NovaException(_('Instance event failed'))
|
||||
|
||||
|
|
|
@ -103,10 +103,6 @@ class LocalAPI(object):
|
|||
def provider_fw_rule_get_all(self, context):
|
||||
return self._manager.provider_fw_rule_get_all(context)
|
||||
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
return self._manager.agent_build_get_by_triple(context, hypervisor,
|
||||
os, architecture)
|
||||
|
||||
def block_device_mapping_create(self, context, values):
|
||||
return self._manager.block_device_mapping_update_or_create(context,
|
||||
values,
|
||||
|
|
|
@ -189,6 +189,7 @@ class ConductorManager(manager.Manager):
|
|||
rules = self.db.provider_fw_rule_get_all(context)
|
||||
return jsonutils.to_primitive(rules)
|
||||
|
||||
# NOTE(danms): This can be removed in version 3.0 of the RPC API
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
info = self.db.agent_build_get_by_triple(context, hypervisor, os,
|
||||
architecture)
|
||||
|
|
|
@ -148,6 +148,7 @@ class ConductorAPI(object):
|
|||
... - Remove instance_fault_create()
|
||||
... - Remove action_event_start() and action_event_finish()
|
||||
... - Remove instance_get_by_uuid()
|
||||
... - Remove agent_build_get_by_triple()
|
||||
"""
|
||||
|
||||
VERSION_ALIASES = {
|
||||
|
@ -205,12 +206,6 @@ class ConductorAPI(object):
|
|||
cctxt = self.client.prepare()
|
||||
return cctxt.call(context, 'provider_fw_rule_get_all')
|
||||
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
cctxt = self.client.prepare()
|
||||
return cctxt.call(context, 'agent_build_get_by_triple',
|
||||
hypervisor=hypervisor, os=os,
|
||||
architecture=architecture)
|
||||
|
||||
def block_device_mapping_update_or_create(self, context, values,
|
||||
create=None):
|
||||
cctxt = self.client.prepare()
|
||||
|
|
|
@ -45,10 +45,6 @@ class VirtAPIBaseTest(test.NoDBTestCase, test.APICoverage):
|
|||
def test_provider_fw_rule_get_all(self):
|
||||
self.assertExpected('provider_fw_rule_get_all')
|
||||
|
||||
def test_agent_build_get_by_triple(self):
|
||||
self.assertExpected('agent_build_get_by_triple',
|
||||
'fake-hv', 'gnu/hurd', 'fake-arch')
|
||||
|
||||
def test_wait_for_instance_event(self):
|
||||
self.assertExpected('wait_for_instance_event',
|
||||
'instance', ['event'])
|
||||
|
|
|
@ -170,17 +170,6 @@ class _BaseTestCase(object):
|
|||
result = self.conductor.provider_fw_rule_get_all(self.context)
|
||||
self.assertEqual(result, fake_rules)
|
||||
|
||||
def test_agent_build_get_by_triple(self):
|
||||
self.mox.StubOutWithMock(db, 'agent_build_get_by_triple')
|
||||
db.agent_build_get_by_triple(self.context, 'fake-hv', 'fake-os',
|
||||
'fake-arch').AndReturn('it worked')
|
||||
self.mox.ReplayAll()
|
||||
result = self.conductor.agent_build_get_by_triple(self.context,
|
||||
'fake-hv',
|
||||
'fake-os',
|
||||
'fake-arch')
|
||||
self.assertEqual(result, 'it worked')
|
||||
|
||||
def test_block_device_mapping_get_all_by_instance(self):
|
||||
fake_inst = {'uuid': 'fake-uuid'}
|
||||
self.mox.StubOutWithMock(db,
|
||||
|
@ -772,6 +761,17 @@ class ConductorTestCase(_BaseTestCase, test.TestCase):
|
|||
self.mox.ReplayAll()
|
||||
self.conductor.action_event_finish(self.context, {})
|
||||
|
||||
def test_agent_build_get_by_triple(self):
|
||||
self.mox.StubOutWithMock(db, 'agent_build_get_by_triple')
|
||||
db.agent_build_get_by_triple(self.context, 'fake-hv', 'fake-os',
|
||||
'fake-arch').AndReturn('it worked')
|
||||
self.mox.ReplayAll()
|
||||
result = self.conductor.agent_build_get_by_triple(self.context,
|
||||
'fake-hv',
|
||||
'fake-os',
|
||||
'fake-arch')
|
||||
self.assertEqual(result, 'it worked')
|
||||
|
||||
|
||||
class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):
|
||||
"""Conductor RPC API Tests."""
|
||||
|
|
|
@ -472,10 +472,6 @@ class FakeVirtAPI(virtapi.VirtAPI):
|
|||
def provider_fw_rule_get_all(self, context):
|
||||
return db.provider_fw_rule_get_all(context)
|
||||
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
return db.agent_build_get_by_triple(context,
|
||||
hypervisor, os, architecture)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def wait_for_instance_event(self, instance, event_names, deadline=300,
|
||||
error_callback=None):
|
||||
|
|
|
@ -22,16 +22,6 @@ class VirtAPI(object):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
|
||||
"""Get information about the available agent builds for a given
|
||||
hypervisor, os, and architecture
|
||||
:param context: security context
|
||||
:param hypervisor: agent hypervisor type
|
||||
:param os: agent operating system type
|
||||
:param architecture: agent architecture
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def wait_for_instance_event(self, instance, event_names, deadline=300,
|
||||
error_callback=None):
|
||||
|
|
Loading…
Reference in New Issue