Update hacking and fix warning

Change-Id: If1358bcfc3f914956f8917cbbcea894f6264febc
This commit is contained in:
Eyal 2020-01-07 14:58:46 +02:00
parent fd02f4c7f8
commit 1c3a3f2248
6 changed files with 26 additions and 24 deletions

View File

@ -103,4 +103,5 @@ class ActionContextSerializer(serialization.DictBasedSerializer):
execution_ctx=ExecutionContext(**entity_dict['execution'])
)
serialization.register_serializer(ActionContext, ActionContextSerializer())

View File

@ -78,4 +78,5 @@ class ResultSerializer(serialization.DictBasedSerializer):
entity_dict.get('cancel', False)
)
serialization.register_serializer(Result, ResultSerializer())

View File

@ -248,7 +248,7 @@ def cut_dict(d, length=100):
idx += 1
if 0 <= length <= len(res) and res[length - 1] is not '}':
if 0 <= length <= len(res) and res[length - 1] != '}':
res = res[:length - 3] + '...'
return res
@ -283,7 +283,7 @@ def cut_list(l, length=100):
res += "'%s'" % s if is_str else s
res += ', ' if idx < len(l) - 1 else ']'
if 0 <= length <= len(res) and res[length - 1] is not ']':
if 0 <= length <= len(res) and res[length - 1] != ']':
res = res[:length - 3] + '...'
return res

View File

@ -2,7 +2,7 @@
# 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
sphinx>=1.8.0,<2.0.0;python_version=='2.7' # BSD
sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD

View File

@ -58,7 +58,7 @@ commands = oslo_debug_helper -t mistral_lib/tests {posargs}
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
ignore = E123,E125,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build