Enable check import order

Enable pep8 import order Using flake8-import-order.

Change-Id: I89e192d9c756156b4e86cbbf2399b9b23fb5edd5
This commit is contained in:
Riccardo Pittau 2020-07-06 14:46:26 +02:00
parent a6d02fb6c2
commit 6e03a55374
20 changed files with 42 additions and 32 deletions

View File

@ -11,10 +11,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""IloClient module"""
import collections
import netaddr
from proliantutils import exception
from proliantutils.ilo import ipmi
from proliantutils.ilo import operations
@ -24,6 +27,7 @@ from proliantutils.ilo.snmp import snmp_cpqdisk_sizes as snmp
from proliantutils import log
from proliantutils.redfish import redfish
SUPPORTED_RIS_METHODS = [
'activate_license',
'clear_secure_boot_keys',

View File

@ -15,6 +15,7 @@
__author__ = 'HPE'
import hashlib
import retrying
from proliantutils import exception

View File

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import collections
from sushy.resources import base
import collections
from proliantutils.redfish.resources.system import constants as sys_cons
from proliantutils.redfish.resources.system import mappings

View File

@ -12,12 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from proliantutils import exception
from proliantutils import log
from sushy.resources import base
from proliantutils import exception
from proliantutils.hpssa import constants
from proliantutils.hpssa import manager
from proliantutils import log
from proliantutils.redfish.resources.system.storage import \
constants as storage_const
from proliantutils.redfish.resources.system.storage import \

View File

@ -14,12 +14,13 @@
import logging
from sushy.resources import base
from sushy import utils as sushy_utils
from proliantutils.redfish.resources.system.storage import logical_drive
from proliantutils.redfish.resources.system.storage import physical_drive
from proliantutils.redfish import utils
from sushy.resources import base
LOG = logging.getLogger(__name__)

View File

@ -12,14 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.
# There is no explicit collection for Drives. That said, a URI link as
# "/redfish/v1/Systems/1/Storage/1/Drives" will be an invalid URI.
from proliantutils.redfish.resources.system.storage import mappings
"""
There is no explicit collection for Drives. That said, a URI link as
"/redfish/v1/Systems/1/Storage/1/Drives" will be an invalid URI.
"""
from sushy.resources import base
from proliantutils.redfish.resources.system.storage import mappings
class Drive(base.ResourceBase):
"""This class represents the Drive resource"""

View File

@ -15,9 +15,8 @@
from sushy.resources import base
from sushy import utils as sushy_utils
from proliantutils.redfish import utils
from proliantutils.redfish.resources.system.storage import mappings
from proliantutils.redfish import utils
class HPELogicalDrive(base.ResourceBase):

View File

@ -15,10 +15,9 @@
from sushy.resources import base
from sushy import utils as sushy_utils
from proliantutils.redfish import utils
from proliantutils.redfish.resources.system.storage import constants
from proliantutils.redfish.resources.system.storage import mappings
from proliantutils.redfish import utils
class HPEPhysicalDrive(base.ResourceBase):

View File

@ -15,6 +15,7 @@
__author__ = 'HPE'
import re
import sushy
from sushy.resources import base
from sushy.resources.system import system
@ -38,7 +39,6 @@ from proliantutils.redfish.resources.system.storage import simple_storage
from proliantutils.redfish.resources.system.storage import \
smart_storage as hpe_smart_storage
from proliantutils.redfish.resources.system.storage import storage
from proliantutils.redfish import utils

View File

@ -15,7 +15,6 @@
__author__ = 'HPE'
import sushy
from sushy.resources import base
from sushy.resources import common as sushy_common

View File

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import time
import mock
import testtools
import time
from proliantutils import exception
from proliantutils.hpssa import manager

View File

@ -19,13 +19,13 @@ import json
import re
import unittest
import xml.etree.ElementTree as ET
import xmltodict
import ddt
import mock
import requests
from requests.packages import urllib3
from requests.packages.urllib3 import exceptions as urllib3_exceptions
import xmltodict
from proliantutils import exception
from proliantutils.ilo import common

View File

@ -12,11 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
import sys
import mock
from oslo_utils import importutils
import six
ironic_python_agent = importutils.try_import('ironic_python_agent')
if not ironic_python_agent:

View File

@ -14,6 +14,7 @@
# under the License.
import json
import mock
import testtools

View File

@ -17,10 +17,9 @@ __author__ = 'HPE'
import json
import mock
import testtools
from sushy import exceptions
from sushy.resources.manager import virtual_media as sushy_virt_media
import testtools
from proliantutils import exception
from proliantutils.redfish.resources.manager import constants

View File

@ -17,6 +17,7 @@ import json
import mock
import sushy
from sushy.resources.system import system as sushy_system
import testtools
from proliantutils import exception
@ -32,7 +33,6 @@ from proliantutils.redfish.resources.system.storage import smart_storage
from proliantutils.redfish.resources.system.storage import storage
from proliantutils.redfish.resources.system import system
from proliantutils.redfish import utils
from sushy.resources.system import system as sushy_system
class HPESystemTestCase(testtools.TestCase):

View File

@ -14,10 +14,11 @@
# under the License.
import json
import time
import mock
import sushy
import testtools
import time
from proliantutils import exception
from proliantutils.ilo import common

View File

@ -14,14 +14,13 @@
# under the License.
import collections
import json
import ddt
import json
import mock
import sushy
import testtools
from sushy.resources.system import system
import testtools
from proliantutils import exception
from proliantutils.ilo import constants as ilo_cons

View File

@ -1,3 +1,7 @@
# linters
hacking>=3.0.0,<3.1.0 # Apache-2.0
flake8-import-order>=0.17.1 # LGPLv3
mock
coverage>=3.6 # Apache-2.0
stestr!=2.3.0 # Apache-2.0

13
tox.ini
View File

@ -22,10 +22,7 @@ commands =
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8]
deps =
hacking>=3.0.0,<3.1.0
commands =
flake8 proliantutils
commands = flake8 {posargs}
[testenv:cover]
# After running this target, visit proliantutils/cover/index.html
@ -42,14 +39,16 @@ commands =
coverage html -d ./cover --omit='*tests*'
[flake8]
show-source = True
# [C901] function is too complex.
# [E731] do not assign a lambda expression, use a def
# [W503] Line break occurred before a binary operator. Conflicts with W504.
ignore = C901,E731,W503
# Exclude MIB directories from flake8/pep8 tests as these are
# autogenerated files.
exclude = ./proliantutils/ilo/snmp/cpqdisk_mibs
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*cpqdisk_mibs
max-complexity=15
import-order-style = pep8
application-import-names = proliantutils
filename = *.py
[testenv:venv]
setenv = PYTHONHASHSEED=0