Update hacking and fix warnings

Change-Id: I47a17e140f1686e901c67c034105eeec1c421ae7
This commit is contained in:
Eyal 2020-01-02 16:06:50 +02:00
parent 6e9a70db25
commit a0663305e5
4 changed files with 6 additions and 5 deletions

View File

@ -237,7 +237,7 @@ class HTTPAction(actions.Action):
# Represent important resp data as a dictionary.
try:
content = resp.json(encoding=resp.encoding)
except Exception as e:
except Exception:
LOG.debug("HTTP action response is not json.")
content = resp.content
if content and resp.encoding not in (None, 'utf-8'):

View File

@ -461,13 +461,13 @@ class Task(object):
def save_started_time(self, value='default'):
if not self.task_ex:
return
time = value if value is not 'default' else utils.utc_now_sec()
time = value if value != 'default' else utils.utc_now_sec()
self.task_ex.started_at = time
def save_finished_time(self, value='default'):
if not self.task_ex:
return
time = value if value is not 'default' else utils.utc_now_sec()
time = value if value != 'default' else utils.utc_now_sec()
self.task_ex.finished_at = time

View File

@ -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>=1.1.0,<1.2.0 # Apache-2.0
hacking>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
croniter>=0.3.4 # MIT License

View File

@ -2,6 +2,7 @@
envlist = py37,pep8
minversion = 2.0
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
@ -96,7 +97,7 @@ whitelist_externals = rm
#Skip PEP257 violation.
[flake8]
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401,E402,W503,E731
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401,E402,W503,E731,W504
show-source = true
builtins = _
# [H106] Don't put vim configuration in source files.