Merge "Update hacking for Python3"

This commit is contained in:
Zuul 2020-04-06 06:43:46 +00:00 committed by Gerrit Code Review
commit fa49143f10
9 changed files with 20 additions and 17 deletions

View File

@ -96,10 +96,10 @@ EXAMPLES = '''
'''
JSON_REG = re.compile('^(?P<host>\w+) \| (?P<status>\w+)!? =>(?P<stdout>.*)$',
JSON_REG = re.compile(r'^(?P<host>\w+) \| (?P<status>\w+)!? =>(?P<stdout>.*)$',
re.MULTILINE | re.DOTALL)
NON_JSON_REG = re.compile(('^(?P<host>\w+) \| (?P<status>\w+)!? \| '
'rc=(?P<exit_code>\d+) >>\n(?P<stdout>.*)\n$'),
NON_JSON_REG = re.compile((r'^(?P<host>\w+) \| (?P<status>\w+)!? \| '
r'rc=(?P<exit_code>\d+) >>\n(?P<stdout>.*)\n$'),
re.MULTILINE | re.DOTALL)
@ -172,7 +172,7 @@ def main():
try:
output = json.loads(json_output)
except Exception as e:
except Exception:
module.fail_json(
msg='Can not parse the inner module output: %s' % json_output)
@ -194,7 +194,7 @@ def main():
# }
try:
ret = output['plays'][0]['tasks'][0]['hosts']['localhost']
except (KeyError, IndexError) as e:
except (KeyError, IndexError):
module.fail_json(
msg='Ansible JSON output has unexpected format: %s' % output)

View File

@ -23,10 +23,8 @@ dogpile.cache==0.6.5
dulwich==0.19.0
extras==1.0.0
fixtures==3.0.0
flake8==2.5.5
gitdb2==2.0.3
GitPython==2.1.8
hacking==1.1.0
idna==2.6
imagesize==1.0.0
iso8601==0.1.12
@ -38,7 +36,6 @@ jsonschema==2.6.0
keystoneauth1==3.4.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
monotonic==1.4
mox3==0.25.0
msgpack==0.5.6
@ -61,7 +58,6 @@ packaging==17.1
pbr==2.0.0
prettytable==0.7.1
pycparser==2.18
pyflakes==0.8.1
Pygments==2.2.0
pyinotify==0.9.6
pyOpenSSL==17.5.0

View File

@ -7,7 +7,7 @@ beautifulsoup4>=4.6.0 # MIT
coverage!=4.4,>=4.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
extras>=1.0.0 # MIT
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0,<3.1.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD

View File

@ -196,5 +196,6 @@ def main():
)
return sum([check() for check in checks])
if __name__ == "__main__":
sys.exit(main())

View File

@ -40,5 +40,6 @@ def main():
sys.exit(res)
if __name__ == '__main__':
main()

View File

@ -98,6 +98,11 @@ commands =
[flake8]
show-source = True
# NOTE: Default ignore list is *not* empty!
# TODO: Enable either W503 or W504:
# W503 line break before binary operator
# W504 line break after binary operator
ignore = W503,W504
exclude=.eggs,.git,.tox,doc
[testenv:lower-constraints]