summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacky06 <zhang.min@99cloud.net>2019-03-06 22:41:58 +0800
committercaoyuan <cao.yuan@99cloud.net>2019-03-27 09:06:39 +0000
commitb8ecb0bc0386fe4b001d6122004c4bb3f6e22a71 (patch)
tree00c673186d0c583f74e10603a0fe5562d84a6dea
parent60a707e73a9ad52cdacd23933cb3a5ac4d419eef (diff)
downloadpython-glanceclient-b8ecb0bc0386fe4b001d6122004c4bb3f6e22a71.tar.gz
Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: Ifc3b96d98c1a7feff187f953d487e12135887fb9
-rw-r--r--glanceclient/common/utils.py8
-rw-r--r--glanceclient/tests/unit/v1/test_shell.py8
-rw-r--r--glanceclient/tests/unit/v2/test_shell_v2.py2
-rw-r--r--glanceclient/v1/shell.py8
-rw-r--r--test-requirements.txt3
-rw-r--r--tox.ini3
6 files changed, 17 insertions, 15 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py
index c92836e..bc0c0eb 100644
--- a/glanceclient/common/utils.py
+++ b/glanceclient/common/utils.py
@@ -28,10 +28,10 @@ import uuid
import six
-if os.name == 'nt':
- import msvcrt
-else:
- msvcrt = None
+if os.name == 'nt': # noqa
+ import msvcrt # noqa
+else: # noqa
+ msvcrt = None # noqa
from oslo_utils import encodeutils
from oslo_utils import strutils
diff --git a/glanceclient/tests/unit/v1/test_shell.py b/glanceclient/tests/unit/v1/test_shell.py
index 95bbd07..a3bd29b 100644
--- a/glanceclient/tests/unit/v1/test_shell.py
+++ b/glanceclient/tests/unit/v1/test_shell.py
@@ -334,8 +334,8 @@ class ShellInvalidEndpointandParameterTest(utils.TestCase):
e = self.assertRaises(exc.CommandError, self.run_command,
'--os-image-api-version 1 image-create ' +
origin + ' fake_src --container-format bare')
- self.assertEqual('error: Must provide --disk-format when using '
- + origin + '.', e.message)
+ self.assertEqual('error: Must provide --disk-format when using ' +
+ origin + '.', e.message)
@mock.patch('sys.stderr')
def test_image_create_missing_container_format(self, __):
@@ -536,8 +536,8 @@ class ShellStdinHandlingTests(testtools.TestCase):
self._do_update()
self.assertTrue(
- 'data' not in self.collected_args[1]
- or self.collected_args[1]['data'] is None
+ 'data' not in self.collected_args[1] or
+ self.collected_args[1]['data'] is None
)
def test_image_update_opened_stdin(self):
diff --git a/glanceclient/tests/unit/v2/test_shell_v2.py b/glanceclient/tests/unit/v2/test_shell_v2.py
index b8161e3..84ef1f0 100644
--- a/glanceclient/tests/unit/v2/test_shell_v2.py
+++ b/glanceclient/tests/unit/v2/test_shell_v2.py
@@ -57,7 +57,7 @@ def schema_args(schema_getter, omit=None):
return original_schema_args(my_schema_getter, omit)
utils.schema_args = schema_args
-from glanceclient.v2 import shell as test_shell
+from glanceclient.v2 import shell as test_shell # noqa
# Return original decorator.
utils.schema_args = original_schema_args
diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py
index fff7490..c60ee3f 100644
--- a/glanceclient/v1/shell.py
+++ b/glanceclient/v1/shell.py
@@ -45,11 +45,11 @@ _bool_strict = functools.partial(strutils.bool_from_string, strict=True)
help='Filter images to those that changed since the given time'
', which will include the deleted images.')
@utils.arg('--container-format', metavar='<CONTAINER_FORMAT>',
- help='Filter images to those that have this container format. '
- + CONTAINER_FORMATS)
+ help='Filter images to those that have this container format. ' +
+ CONTAINER_FORMATS)
@utils.arg('--disk-format', metavar='<DISK_FORMAT>',
- help='Filter images to those that have this disk format. '
- + DISK_FORMATS)
+ help='Filter images to those that have this disk format. ' +
+ DISK_FORMATS)
@utils.arg('--size-min', metavar='<SIZE>', type=int,
help='Filter images to those with a size greater than this.')
@utils.arg('--size-max', metavar='<SIZE>', type=int,
diff --git a/test-requirements.txt b/test-requirements.txt
index 0424393..8e8541c 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,7 +1,8 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
+
+hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD
diff --git a/tox.ini b/tox.ini
index b2b2865..27170de 100644
--- a/tox.ini
+++ b/tox.ini
@@ -74,7 +74,8 @@ commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
-ignore = F403,F812,F821
+# E731 skipped as assign a lambda expression
+ignore = E731,F403,F812,F821
show-source = True
exclude = .venv*,.tox,dist,*egg,build,.git,doc,*lib/python*,.update-venv