From a0663305e566a6129d576fe9caf41120b3f02333 Mon Sep 17 00:00:00 2001 From: Eyal Date: Thu, 2 Jan 2020 16:06:50 +0200 Subject: [PATCH] Update hacking and fix warnings Change-Id: I47a17e140f1686e901c67c034105eeec1c421ae7 --- mistral/actions/std_actions.py | 2 +- mistral/engine/tasks.py | 4 ++-- test-requirements.txt | 2 +- tox.ini | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mistral/actions/std_actions.py b/mistral/actions/std_actions.py index 30ed6d44f..454b10c78 100644 --- a/mistral/actions/std_actions.py +++ b/mistral/actions/std_actions.py @@ -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'): diff --git a/mistral/engine/tasks.py b/mistral/engine/tasks.py index 518c7abec..493fe0a67 100644 --- a/mistral/engine/tasks.py +++ b/mistral/engine/tasks.py @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index bb2db3723..3f1daa245 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>=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 diff --git a/tox.ini b/tox.ini index 11a187cd3..5490dae7c 100644 --- a/tox.ini +++ b/tox.ini @@ -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.