Skip to content

Commit

Permalink
Update hacking for Python3
Browse files Browse the repository at this point in the history
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Change-Id: I8d4a0fc1b7c4e0c1e474a707aa900d09181ba11f
  • Loading branch information
ajaeger committed Mar 31, 2020
1 parent d5b61d1 commit d57a5f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test-requirements.txt
Expand Up @@ -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>=3.0,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=1.10.0 # Apache-2.0
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Expand Up @@ -72,13 +72,15 @@ commands =
#
# H404 skipped on purpose per jay pipes discussion.
#
# W504 line break after binary operator
#
# Due to the upgrade to hacking 0.9.2 the following checking are
# ignored on purpose for the moment and should be re-enabled.
# H106: Don’t put vim configuration in source files
# H203: Use assertIs(Not)None to check for None

show-source = True
ignore = E123,E125,E126,E127,E128,E251,E265,H302,H405,H904,H404
ignore = E123,E125,E126,E127,E128,E251,E265,H302,H405,H904,H404,W504
enable-extensions=H106,H203
builtins = _
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build
Expand Down
1 change: 1 addition & 0 deletions vif_plug_linux_bridge/iptables.py
Expand Up @@ -39,6 +39,7 @@ def get_binary_name():
"""Grab the name of the binary we're running in."""
return os.path.basename(inspect.stack()[-1][1])[:16]


binary_name = get_binary_name()


Expand Down
10 changes: 5 additions & 5 deletions vif_plug_ovs/linux_net.py
Expand Up @@ -287,11 +287,11 @@ def get_representor_port(pf_ifname, vf_num):
# the PCI func number of pf_ifname.
rep_parent_pf_func = _parse_pf_number(phys_port_name)
if rep_parent_pf_func is not None:
ifname_pf_func = _get_pf_func(pf_ifname)
if ifname_pf_func is None:
continue
if int(rep_parent_pf_func) != int(ifname_pf_func):
continue
ifname_pf_func = _get_pf_func(pf_ifname)
if ifname_pf_func is None:
continue
if int(rep_parent_pf_func) != int(ifname_pf_func):
continue

representor_num = _parse_vf_number(phys_port_name)
# Note: representor_num can be 0, referring to VF0
Expand Down

0 comments on commit d57a5f3

Please sign in to comment.