Remove get_node_uuid

get_node_uuid was added in [1] and it was used [2], but that code was
removed in Stein [3].

[1] I982b211e0315bdb9a816f346fafffd0f70e46d07
[2] 76136bfb01/nova/compute/manager.py (L3939)
[3] I0851e2d54a1fdc82fe3291fb7e286e790f121e92

Change-Id: I3cd3565b6651677552d8a27c9f7054b0322055fb
This commit is contained in:
Eric Fried 2018-11-28 16:24:05 -06:00
parent 3b2e42f371
commit 8c318d0fb2
3 changed files with 0 additions and 19 deletions

View File

@ -152,12 +152,6 @@ class ResourceTracker(object):
self.cpu_allocation_ratio = CONF.cpu_allocation_ratio
self.disk_allocation_ratio = CONF.disk_allocation_ratio
def get_node_uuid(self, nodename):
try:
return self.compute_nodes[nodename].uuid
except KeyError:
raise exception.ComputeHostNotFound(host=nodename)
@utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)
def instance_claim(self, context, instance, nodename, limits=None):
"""Indicate that some resources are needed for an upcoming compute

View File

@ -6546,7 +6546,6 @@ class ComputeTestCase(BaseTestCase,
post_live_migration_at_source, setup_networks_on_host,
clear_events, update_available_resource, mig_save, getrt
):
getrt.return_value.get_node_uuid.return_value = srcnode
self.compute._post_live_migration(c, instance, dest,
migrate_data=migrate_data)
update_available_resource.assert_has_calls([mock.call(c)])

View File

@ -1536,18 +1536,6 @@ class TestUpdateComputeNode(BaseTestCase):
self.assertEqual(4, ufpt_mock.call_count)
def test_get_node_uuid(self):
self._setup_rt()
orig_compute = _COMPUTE_NODE_FIXTURES[0].obj_clone()
self.rt.compute_nodes[_NODENAME] = orig_compute
uuid = self.rt.get_node_uuid(_NODENAME)
self.assertEqual(orig_compute.uuid, uuid)
def test_get_node_uuid_not_found(self):
self._setup_rt()
self.assertRaises(exc.ComputeHostNotFound,
self.rt.get_node_uuid, 'foo')
def test_copy_resources_no_update_allocation_ratios(self):
"""Tests that a ComputeNode object's allocation ratio fields are
not set if the configured allocation ratio values are default 0.0.