trivial: Remove dead code

Picked up with vulture [1].

[1] https://pypi.org/project/vulture/

Change-Id: I0b318ea5309d201499f0a9ef6f205425c89e6946
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2019-12-12 10:55:02 +00:00
parent 4a36ae9684
commit 05aaa7a23f
5 changed files with 11 additions and 20 deletions

View File

@ -30,13 +30,6 @@ from nova.policies import baremetal_nodes as bn_policies
ironic_client = importutils.try_import('ironicclient.client')
ironic_exc = importutils.try_import('ironicclient.exc')
node_fields = ['id', 'cpus', 'local_gb', 'memory_mb', 'pm_address',
'pm_user', 'service_host', 'terminal_port', 'instance_uuid']
node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path']
interface_fields = ['id', 'address', 'datapath_id', 'port_no']
CONF = nova.conf.CONF

View File

@ -207,9 +207,6 @@ valid_name_leading_trailing_spaces_regex = ValidationRegex(
_("printable characters with at least one non space character"))
valid_name_regex_obj = re.compile(valid_name_regex.regex, re.UNICODE)
valid_description_regex_base = '^[%s]*$'

View File

@ -138,15 +138,6 @@ def get_flavor_by_flavor_id(flavorid, ctxt=None, read_deleted="yes"):
return objects.Flavor.get_by_flavor_id(ctxt, flavorid, read_deleted)
def get_flavor_access_by_flavor_id(flavorid, ctxt=None):
"""Retrieve flavor access list by flavor id."""
if ctxt is None:
ctxt = context.get_admin_context()
flavor = objects.Flavor.get_by_flavor_id(ctxt, flavorid)
return flavor.projects
# NOTE(danms): This method is deprecated, do not use it!
# Use instance.{old_,new_,}flavor instead, as instances no longer
# have flavor information in system_metadata.

View File

@ -284,6 +284,7 @@ class KeyPair(API_BASE):
nullable=False, server_default='ssh')
# TODO(stephenfin): Remove this as it's now unused post-placement split
class ResourceClass(API_BASE):
"""Represents the type of resource for an inventory or allocation."""
__tablename__ = 'resource_classes'
@ -295,6 +296,7 @@ class ResourceClass(API_BASE):
name = Column(String(255), nullable=False)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class ResourceProvider(API_BASE):
"""Represents a mapping to a providers of resources."""
@ -325,6 +327,7 @@ class ResourceProvider(API_BASE):
nullable=True)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class Inventory(API_BASE):
"""Represents a quantity of available resource."""
@ -356,6 +359,7 @@ class Inventory(API_BASE):
foreign_keys=resource_provider_id)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class Allocation(API_BASE):
"""A use of inventory."""
@ -381,6 +385,7 @@ class Allocation(API_BASE):
foreign_keys=resource_provider_id)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class ResourceProviderAggregate(API_BASE):
"""Associate a resource provider with an aggregate."""
@ -394,6 +399,7 @@ class ResourceProviderAggregate(API_BASE):
aggregate_id = Column(Integer, primary_key=True, nullable=False)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class PlacementAggregate(API_BASE):
"""A grouping of resource providers."""
__tablename__ = 'placement_aggregates'
@ -597,6 +603,7 @@ class Trait(API_BASE):
name = Column(Unicode(255), nullable=False)
# TODO(stephenfin): Remove this as it's now unused post-placement split
class ResourceProviderTrait(API_BASE):
"""Represents the relationship between traits and resource provider"""
@ -614,6 +621,7 @@ class ResourceProviderTrait(API_BASE):
nullable=False)
# TODO(stephenfin): Remove this as it's unused
class Project(API_BASE):
"""The project is the Keystone project."""
@ -629,6 +637,7 @@ class Project(API_BASE):
external_id = Column(String(255), nullable=False)
# TODO(stephenfin): Remove this as it's unused
class User(API_BASE):
"""The user is the Keystone user."""
@ -644,6 +653,7 @@ class User(API_BASE):
external_id = Column(String(255), nullable=False)
# TODO(stephenfin): Remove this as it's unused
class Consumer(API_BASE):
"""Represents a resource consumer."""

View File

@ -80,7 +80,7 @@ class BaseLoader(object):
in the directory that defines this class.
"""
classes = []
for dirpath, dirnames, filenames in os.walk(self.path):
for dirpath, _, filenames in os.walk(self.path):
relpath = os.path.relpath(dirpath, self.path)
if relpath == '.':
relpkg = ''