Unpin flake8-import-order

... to resolve the following ValueError.

```
ValueError: 'string' is not callable
```

The I202 test is disabled because multiple files need updates. It may
be enabled later once all the warnings are addressed.

Fixed E721 test errors which appears 4 times.

E721 do not compare types, for exact checks use `is` / `is not`, for
instance checks use `isinstance()`

Change-Id: I68880b83c8a555ed30c3ce18b73ae27b8db34dc8
This commit is contained in:
Takashi Kajinami 2023-12-14 21:47:34 +09:00
parent 261ee7dcff
commit 2a327582f7
3 changed files with 7 additions and 6 deletions

View File

@ -50,9 +50,9 @@ class LocalCertManager(cert_mgr.CertManager):
"""
cert_ref = str(uuid.uuid4())
filename_base = os.path.join(CONF.certificates.storage_path, cert_ref)
if type(certificate) == bytes:
if isinstance(certificate, bytes):
certificate = certificate.decode('utf-8')
if type(private_key) == bytes:
if isinstance(private_key, bytes):
private_key = private_key.decode('utf-8')
LOG.info("Storing certificate data on the local filesystem.")
@ -71,7 +71,7 @@ class LocalCertManager(cert_mgr.CertManager):
if intermediates:
filename_intermediates = "{0}.int".format(filename_base)
if type(intermediates) == bytes:
if isinstance(intermediates, bytes):
intermediates = intermediates.decode('utf-8')
with os.fdopen(os.open(
filename_intermediates, flags, mode), 'w') as int_file:
@ -79,7 +79,7 @@ class LocalCertManager(cert_mgr.CertManager):
if private_key_passphrase:
filename_pkp = "{0}.pass".format(filename_base)
if type(private_key_passphrase) == bytes:
if isinstance(private_key_passphrase, bytes):
private_key_passphrase = private_key_passphrase.decode(
'utf-8')
with os.fdopen(os.open(

View File

@ -5,7 +5,7 @@ hacking>=3.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3
flake8-import-order # LGPLv3
python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0
pylint>=2.5.3 # GPLv2

View File

@ -147,7 +147,8 @@ commands = bandit -r octavia -ll -ii -x tests
[flake8]
# [H104]: Empty file with only comments
# [W504]: Line break after binary operator
ignore = H104,W504
# [I202]: Additional newline in a group of imports.
ignore = H104,W504,I202
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build