Fix E501 errors

Task: #19602
Story: #2001985
Change-Id: I6120b1447819ab3e8b2fb4a7fb8e412dc6ce5034
This commit is contained in:
Julia Kreger 2018-05-08 12:57:36 -07:00
parent 5839bbad39
commit 2846852fef
10 changed files with 24 additions and 17 deletions

View File

@ -155,7 +155,8 @@ def is_image_available(context, image):
return True
if ((getattr(image, 'is_public', None)
or getattr(image, 'visibility', None) == 'public') or context.is_admin):
or getattr(image, 'visibility', None) == 'public')
or context.is_admin):
return True
properties = image.properties
if context.project_id and ('owner_id' in properties):

View File

@ -490,7 +490,8 @@ class BaseConductorManager(object):
with task_manager.acquire(context, node_uuid,
purpose='node state check') as task:
if (task.node.maintenance
or task.node.provision_state not in provision_state):
or task.node.provision_state
not in provision_state):
continue
target_state = (None if not keep_target_state else

View File

@ -203,7 +203,8 @@ class ConductorManager(base_manager.BaseConductorManager):
# result in the new resource class exposed on the node as available
# for consumption, and nova may try to schedule on this node again.
if ('resource_class' in delta and task.node.resource_class
and task.node.provision_state not in allowed_update_states):
and task.node.provision_state
not in allowed_update_states):
raise exception.InvalidState(
action % {'node': node_obj.uuid,
'allowed': ', '.join(allowed_update_states),
@ -1938,7 +1939,8 @@ class ConductorManager(base_manager.BaseConductorManager):
# INSPECTIONFAIL -> MANAGEABLE
# DEPLOYFAIL -> DELETING
if (not node.maintenance
and node.provision_state not in states.DELETE_ALLOWED_STATES):
and node.provision_state
not in states.DELETE_ALLOWED_STATES):
msg = (_('Can not delete node "%(node)s" while it is in '
'provision state "%(state)s". Valid provision states '
'to perform deletion are: "%(valid_states)s", '

View File

@ -77,7 +77,7 @@ def _wrap_session(session):
def _get_node_query_with_all():
"""Return a query object for the Node model joined with all relevant fields.
"""Return a query object for the Node joined with all relevant fields.
:returns: a query object.
"""
@ -254,7 +254,8 @@ class Connection(api.Connection):
filters['reserved_by_any_of']))
if 'provisioned_before' in filters:
limit = (timeutils.utcnow()
- datetime.timedelta(seconds=filters['provisioned_before']))
- datetime.timedelta(
seconds=filters['provisioned_before']))
query = query.filter(models.Node.provision_updated_at < limit)
if 'inspection_started_before' in filters:
limit = ((timeutils.utcnow())

View File

@ -417,7 +417,7 @@ def _validate_server_profile_template_server_hardware_type(
def _validate_spt_enclosure_group(server_profile_template, server_hardware):
"""Validate Server Profile Template's Enclosure Group and Server Hardware's.
"""Validate Server Profile Template's Enclosure Group and Hardware's.
:param: server_profile_template: OneView Server Profile Template object.
:param: server_hardware: OneView Server Hardware object.

View File

@ -42,7 +42,7 @@ class OneViewInspect(inspector.Inspector):
@METRICS.timer('OneViewInspect.validate')
def validate(self, task):
"""Checks required info on 'driver_info' and validates node with OneView
"""Checks required info on 'driver_info' and validates node for OneView
Validates whether the 'driver_info' property of the supplied
task's node contains the required info such as server_hardware_uri,

View File

@ -185,7 +185,7 @@ class OneViewManagement(base.ManagementInterface):
@METRICS.timer('OneViewManagement.validate')
def validate(self, task):
"""Checks required info on 'driver_info' and validates node with OneView
"""Checks required info on 'driver_info' and validates node for OneView
Validates whether the 'driver_info' property of the supplied
task's node contains the required info such as server_hardware_uri,

View File

@ -69,7 +69,7 @@ class OneViewPower(base.PowerInterface):
@METRICS.timer('OneViewPower.validate')
def validate(self, task):
"""Checks required info on 'driver_info' and validates node with OneView
"""Checks required info on 'driver_info' and validates node for OneView
Validates whether the 'oneview_info' property of the supplied
task's node contains the required info such as server_hardware_uri,

View File

@ -146,7 +146,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
# @object_base.remotable_classmethod
@classmethod
def get_by_id(cls, context, portgroup_id):
"""Find a portgroup based on its integer ID and return a Portgroup object.
"""Find a portgroup by its integer ID and return a Portgroup object.
:param cls: the :class:`Portgroup`
:param context: Security context
@ -165,7 +165,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
# @object_base.remotable_classmethod
@classmethod
def get_by_uuid(cls, context, uuid):
"""Find a portgroup based on UUID and return a :class:`Portgroup` object.
"""Find a portgroup by UUID and return a :class:`Portgroup` object.
:param cls: the :class:`Portgroup`
:param context: Security context
@ -184,7 +184,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
# @object_base.remotable_classmethod
@classmethod
def get_by_address(cls, context, address):
"""Find a portgroup based on address and return a :class:`Portgroup` object.
"""Find portgroup by address and return a :class:`Portgroup` object.
:param cls: the :class:`Portgroup`
:param context: Security context
@ -203,7 +203,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
# @object_base.remotable_classmethod
@classmethod
def get_by_name(cls, context, name):
"""Find a portgroup based on name and return a :class:`Portgroup` object.
"""Find portgroup based on name and return a :class:`Portgroup` object.
:param cls: the :class:`Portgroup`
:param context: Security context

View File

@ -106,9 +106,11 @@ commands = {posargs}
[flake8]
# [W503] Line break before binary operator.
# NOTE(TheJulia): Adding W606,E501 to the ignore list
# until we are able to clean them up in the code base.
ignore = E129,W503,W606,E501
# NOTE(TheJulia): Adding W606 to the ignore list
# until we are able to remove them due to deprecation
# period passing. Patch merged in March 2018 to rename
# method arguments from reserved keywords.
ignore = E129,W503,W606
filename = *.py,app.wsgi
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8