summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhijunWei <wzj334965317@outlook.com>2018-12-28 23:04:07 +0800
committerZhijunWei <wzj334965317@outlook.com>2019-01-04 14:46:07 +0800
commit85e9b58e9b638bc49679d2c7460dd1db7f39f48a (patch)
tree4edf2d7739d2f5e339a114146a2d606e1473c8aa
parentb13ba0138f6ee2e10ce3b4b95aee37c6cebd1f20 (diff)
downloadpython-novaclient-85e9b58e9b638bc49679d2c7460dd1db7f39f48a.tar.gz
Update hacking version
1. update hacking version to latest 2. fix the pep8 failed Change-Id: I484a40fe3cb868d223a807edcd3e20f5e0ebdf4e
-rw-r--r--lower-constraints.txt2
-rw-r--r--novaclient/api_versions.py8
-rw-r--r--novaclient/client.py6
-rw-r--r--novaclient/shell.py4
-rw-r--r--novaclient/tests/unit/fixture_data/server_groups.py4
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini2
7 files changed, 14 insertions, 14 deletions
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 5d9d5197..350574be 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -25,7 +25,7 @@ futurist==1.2.0
gitdb==0.6.4
GitPython==1.0.1
greenlet==0.4.10
-hacking==0.12.0
+hacking==1.1.0
idna==2.6
iso8601==0.1.11
Jinja2==2.10
diff --git a/novaclient/api_versions.py b/novaclient/api_versions.py
index 23176519..5ff52b8f 100644
--- a/novaclient/api_versions.py
+++ b/novaclient/api_versions.py
@@ -324,11 +324,11 @@ def update_headers(headers, api_version):
def check_headers(response, api_version):
"""Checks that microversion header is in response."""
if api_version.ver_minor > 0:
- if (api_version.ver_minor < 27
- and LEGACY_HEADER_NAME not in response.headers):
+ if (api_version.ver_minor < 27 and
+ LEGACY_HEADER_NAME not in response.headers):
_warn_missing_microversion_header(LEGACY_HEADER_NAME)
- elif (api_version.ver_minor >= 27
- and HEADER_NAME not in response.headers):
+ elif (api_version.ver_minor >= 27 and
+ HEADER_NAME not in response.headers):
_warn_missing_microversion_header(HEADER_NAME)
diff --git a/novaclient/client.py b/novaclient/client.py
index 2d271631..76a2007b 100644
--- a/novaclient/client.py
+++ b/novaclient/client.py
@@ -30,9 +30,6 @@ from keystoneauth1 import session as ksession
from oslo_utils import importutils
import pkg_resources
-osprofiler_profiler = importutils.try_import("osprofiler.profiler")
-osprofiler_web = importutils.try_import("osprofiler.web")
-
import novaclient
from novaclient import api_versions
from novaclient import exceptions
@@ -40,6 +37,9 @@ from novaclient import extension as ext
from novaclient.i18n import _
from novaclient import utils
+osprofiler_profiler = importutils.try_import("osprofiler.profiler")
+osprofiler_web = importutils.try_import("osprofiler.web")
+
# TODO(jichenjc): when an extension in contrib is moved to core extension,
# Add the name into the following list, then after last patch merged,
# remove the whole function
diff --git a/novaclient/shell.py b/novaclient/shell.py
index 8eb4311c..2f6a33e8 100644
--- a/novaclient/shell.py
+++ b/novaclient/shell.py
@@ -29,8 +29,6 @@ from oslo_utils import importutils
from oslo_utils import strutils
import six
-osprofiler_profiler = importutils.try_import("osprofiler.profiler")
-
import novaclient
from novaclient import api_versions
from novaclient import client
@@ -39,6 +37,8 @@ import novaclient.extension
from novaclient.i18n import _
from novaclient import utils
+osprofiler_profiler = importutils.try_import("osprofiler.profiler")
+
DEFAULT_MAJOR_OS_COMPUTE_API_VERSION = "2.0"
# The default behaviour of nova client CLI is that CLI negotiates with server
# to find out the most recent version between client and server, and
diff --git a/novaclient/tests/unit/fixture_data/server_groups.py b/novaclient/tests/unit/fixture_data/server_groups.py
index 5c4c88c6..d2fd43c7 100644
--- a/novaclient/tests/unit/fixture_data/server_groups.py
+++ b/novaclient/tests/unit/fixture_data/server_groups.py
@@ -87,8 +87,8 @@ class Fixture(base.Fixture):
headers=headers)
self.requests_mock.get(self.url(all_projects=True),
- json={'server_groups': server_groups
- + other_project_server_groups},
+ json={'server_groups': server_groups +
+ other_project_server_groups},
headers=headers)
self.requests_mock.get(self.url(limit=2, offset=1),
diff --git a/test-requirements.txt b/test-requirements.txt
index b01fb80a..83326f07 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,7 +1,7 @@
# 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
bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 50896682..0e6b4bbe 100644
--- a/tox.ini
+++ b/tox.ini
@@ -93,7 +93,7 @@ commands =
# Following checks are ignored on purpose.
#
# Additional checks are also ignored on purpose: F811, F821
-ignore = F811,F821,H404,H405
+ignore = E731,F811,F821,H404,H405
show-source = True
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasenotes