virt: Remove 'get_console_pool_info' API

This is no longer used by any in-tree virt drivers and can be removed.
The equivalent RPC API now always raises 'NotImplementedError', which
was the behavior with virt drivers that didn't support the feature.

Change-Id: Iab881ef4f52eff4815e781f10204497968f8a06b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-08-31 17:17:32 +01:00
parent 1fd44eb56f
commit 912b717207
6 changed files with 2 additions and 28 deletions

View File

@ -1578,7 +1578,7 @@ class ComputeManager(manager.Manager):
# TODO(stephenfin): Remove this once we bump the compute API to v6.0
@wrap_exception()
def get_console_pool_info(self, context, console_type):
return self.driver.get_console_pool_info(console_type)
raise NotImplementedError()
# TODO(stephenfin): Remove this as it's nova-network only
@wrap_exception()

View File

@ -780,6 +780,7 @@ class ComputeAPI(object):
return cctxt.call(ctxt, 'get_console_output',
instance=instance, tail_length=tail_length)
# TODO(stephenfin): This is no longer used and can be removed in v6.0
def get_console_pool_info(self, ctxt, host, console_type):
version = '5.0'
cctxt = self.router.client(ctxt).prepare(

View File

@ -576,14 +576,6 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
instance_ref)
self.assertIsInstance(mks_console, ctype.ConsoleMKS)
@catch_notimplementederror
def test_get_console_pool_info(self):
instance_ref, network_info = self._get_running_instance()
console_pool = self.connection.get_console_pool_info(instance_ref)
self.assertIn('address', console_pool)
self.assertIn('username', console_pool)
self.assertIn('password', console_pool)
@mock.patch(
'nova.tests.unit.virt.libvirt.fakelibvirt.Domain.jobStats',
new=mock.Mock(return_value={

View File

@ -459,12 +459,6 @@ class ComputeDriver(object):
"""
raise NotImplementedError()
# TODO(stephenfin): This was only implemented (properly) for XenAPI and
# should be removed.
def get_console_pool_info(self, console_type):
# TODO(Vek): Need to pass context in for access to auth_token
raise NotImplementedError()
def get_console_output(self, context, instance):
"""Get console output for an instance

View File

@ -488,11 +488,6 @@ class FakeDriver(driver.ComputeDriver):
host='fakemksconsole.com',
port=6969)
def get_console_pool_info(self, console_type):
return {'address': '127.0.0.1',
'username': 'fakeuser',
'password': 'fakepassword'}
def get_available_resource(self, nodename):
"""Updates compute manager resource info on ComputeNode table.

View File

@ -7719,14 +7719,6 @@ class LibvirtDriver(driver.ComputeDriver):
'Cannot get block stats for device', instance.name,
instance=instance)
def get_console_pool_info(self, console_type):
# TODO(mdragon): console proxy should be implemented for libvirt,
# in case someone wants to use it with kvm or
# such. For now return fake data.
return {'address': '127.0.0.1',
'username': 'fakeuser',
'password': 'fakepassword'}
def update_provider_tree(self, provider_tree, nodename, allocations=None):
"""Update a ProviderTree object with current resource provider,
inventory information and CPU traits.