From 5d0daffaa12aa148512bd52b9a2b7dacfb46acfa Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 3 Apr 2019 14:41:01 +0100 Subject: [PATCH] Remove dead code Far as I can tell, this has no users outside of a unit test and can therefore be removed. Change-Id: I844959d2a6cf956cb59a78fddbec5301fb9fdc4b Signed-off-by: Stephen Finucane --- placement/objects/allocation_candidate.py | 7 ------- .../unit/objects/test_allocation_candidate.py | 14 -------------- 2 files changed, 21 deletions(-) diff --git a/placement/objects/allocation_candidate.py b/placement/objects/allocation_candidate.py index 750e8493a..c379c17c9 100644 --- a/placement/objects/allocation_candidate.py +++ b/placement/objects/allocation_candidate.py @@ -309,13 +309,6 @@ class ProviderSummary(object): self.resources = resources or [] self.traits = traits or [] - @property - def resource_class_names(self): - """Helper property that returns a set() of resource class string names - that are included in the provider summary. - """ - return set(res.resource_class for res in self.resources) - class ProviderSummaryResource(object): diff --git a/placement/tests/unit/objects/test_allocation_candidate.py b/placement/tests/unit/objects/test_allocation_candidate.py index 4d0e96f6f..7f6c9abb4 100644 --- a/placement/tests/unit/objects/test_allocation_candidate.py +++ b/placement/tests/unit/objects/test_allocation_candidate.py @@ -11,7 +11,6 @@ # under the License. import mock -import os_resource_classes as orc from placement.objects import allocation_candidate from placement.tests.unit.objects import base @@ -46,16 +45,3 @@ class TestAllocationCandidatesNoDB(base.TestCase): self.context, aro_in, sum_in, 2) self.assertEqual(aro_in[:2], aro) self.assertEqual(set([sum1, sum0, sum4, sum8, sum5]), set(sum)) - - -class TestProviderSummaryNoDB(base.TestCase): - - def test_resource_class_names(self): - psum = allocation_candidate.ProviderSummary(mock.sentinel.ctx) - disk_psr = allocation_candidate.ProviderSummaryResource( - resource_class=orc.DISK_GB, capacity=100, used=0) - ram_psr = allocation_candidate.ProviderSummaryResource( - resource_class=orc.MEMORY_MB, capacity=1024, used=0) - psum.resources = [disk_psr, ram_psr] - expected = set(['DISK_GB', 'MEMORY_MB']) - self.assertEqual(expected, psum.resource_class_names)