diff options
author | Eric Harney <eharney@redhat.com> | 2020-07-16 10:21:28 -0400 |
---|---|---|
committer | Eric Harney <eharney@redhat.com> | 2020-07-16 10:51:55 -0400 |
commit | 1dc592a6fd6693288f479ad770b0ccdac0b48607 (patch) | |
tree | 8762daed529270ff21c60497eca9b360d1fb4823 | |
parent | b6b308ed23b5b3d9ddd8aa946a31edec6b35cbe4 (diff) | |
download | python-cinderclient-1dc592a6fd6693288f479ad770b0ccdac0b48607.tar.gz |
Bump hacking to 3.1.0
pycodestyle does not know about "importutils.try_import"
calls, so we have to either
a) put them inside a "try" block
or
b) add "# noqa: E402" to each import after the
try_import call
Change-Id: Ia545bb689cfdfb57962d74e3957dfb372fd3782b
-rw-r--r-- | cinderclient/client.py | 5 | ||||
-rw-r--r-- | cinderclient/shell.py | 5 | ||||
-rw-r--r-- | cinderclient/tests/unit/v2/test_limits.py | 4 | ||||
-rw-r--r-- | cinderclient/utils.py | 2 | ||||
-rw-r--r-- | test-requirements.txt | 2 |
5 files changed, 12 insertions, 6 deletions
diff --git a/cinderclient/client.py b/cinderclient/client.py index 6193e95..485acd9 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -35,7 +35,10 @@ from keystoneauth1.identity import base from oslo_utils import encodeutils from oslo_utils import importutils from oslo_utils import strutils -osprofiler_web = importutils.try_import("osprofiler.web") # noqa +try: + osprofiler_web = importutils.try_import("osprofiler.web") +except Exception: + pass import requests from six.moves import urllib import six.moves.urllib.parse as urlparse diff --git a/cinderclient/shell.py b/cinderclient/shell.py index acbccda..7fddb5a 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -33,7 +33,10 @@ from keystoneauth1 import loading from keystoneauth1 import session from oslo_utils import encodeutils from oslo_utils import importutils -osprofiler_profiler = importutils.try_import("osprofiler.profiler") # noqa +try: + osprofiler_profiler = importutils.try_import("osprofiler.profiler") +except Exception: + pass import requests import six import six.moves.urllib.parse as urlparse diff --git a/cinderclient/tests/unit/v2/test_limits.py b/cinderclient/tests/unit/v2/test_limits.py index 34ed1d2..d8fbdfe 100644 --- a/cinderclient/tests/unit/v2/test_limits.py +++ b/cinderclient/tests/unit/v2/test_limits.py @@ -177,5 +177,5 @@ class TestLimitsManager(utils.TestCase): api.client.get.assert_called_once_with('/limits%s' % query_str) self.assertIsInstance(lim, limits.Limits) - for l in lim.absolute: - self.assertEqual(l1, l) + for limit in lim.absolute: + self.assertEqual(l1, limit) diff --git a/cinderclient/utils.py b/cinderclient/utils.py index 28c458d..04236a3 100644 --- a/cinderclient/utils.py +++ b/cinderclient/utils.py @@ -199,7 +199,7 @@ def unicode_key_value_to_string(src): _encode(unicode_key_value_to_string(v))) for k, v in src.items()) if isinstance(src, list): - return [unicode_key_value_to_string(l) for l in src] + return [unicode_key_value_to_string(item) for item in src] return _encode(src) diff --git a/test-requirements.txt b/test-requirements.txt index fdc3d25..065e127 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8, pyflakes and flake8 -hacking>=3.0.1,<3.1.0 # Apache-2.0 +hacking>=3.1.0,<3.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT fixtures>=3.0.0 # Apache-2.0/BSD |