Nix unused raise_if_custom_resource_class_pre_v1_1

The only reference to
nova.db.sqlalchemy.resource_class_cache.raise_if_custom_resource_class_pre_v1_1
was removed in Ideca0f09f5dc4ba6bb194a2413ed93cf592dd963.  This was also the
only place nova.rc_fields.ResourceClass.V1_0 was used.  This patch removes
both.

Change-Id: I17081666db55e2cca21852bb5f520accb2c807a2
This commit is contained in:
Eric Fried 2018-06-15 15:47:29 -05:00
parent 877a8bcb9f
commit 8de155f817
2 changed files with 0 additions and 24 deletions

View File

@ -11,7 +11,6 @@
# under the License.
from oslo_concurrency import lockutils
import six
import sqlalchemy as sa
# TODO(cdent): This file and its location is problematic for placement
@ -26,23 +25,6 @@ _RC_TBL = models.ResourceClass.__table__
_LOCKNAME = 'rc_cache'
def raise_if_custom_resource_class_pre_v1_1(rc):
"""Raises ValueError if the supplied resource class identifier is
*not* in the set of standard resource classes as of Inventory/Allocation
object version 1.1
param rc: Integer or string identifier for a resource class
"""
if isinstance(rc, six.string_types):
if rc not in fields.ResourceClass.V1_0:
raise ValueError
else:
try:
fields.ResourceClass.V1_0[rc]
except IndexError:
raise ValueError
@db_api.placement_context_manager.reader
def _refresh_from_db(ctx, cache):
"""Grabs all custom resource classes from the DB table and populates the

View File

@ -48,12 +48,6 @@ class ResourceClass(fields.StringField):
NUMA_SOCKET, NUMA_CORE, NUMA_THREAD, NUMA_MEMORY_MB,
IPV4_ADDRESS, VGPU, VGPU_DISPLAY_HEAD)
# This is the set of standard resource classes that existed before
# we opened up for custom resource classes in version 1.1 of various
# objects in nova/objects/resource_provider.py
V1_0 = (VCPU, MEMORY_MB, DISK_GB, PCI_DEVICE, SRIOV_NET_VF, NUMA_SOCKET,
NUMA_CORE, NUMA_THREAD, NUMA_MEMORY_MB, IPV4_ADDRESS)
@classmethod
def normalize_name(cls, rc_name):
if rc_name is None: