Browse Source

Update hacking for Python3

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
tags/2.1.0
Andreas Jaeger 3 months ago
committed by Andreas Jaeger
parent
commit
d57a5f39ed
4 changed files with 10 additions and 7 deletions
  1. +1
    -1
      test-requirements.txt
  2. +3
    -1
      tox.ini
  3. +1
    -0
      vif_plug_linux_bridge/iptables.py
  4. +5
    -5
      vif_plug_ovs/linux_net.py

+ 1
- 1
test-requirements.txt 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>=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


+ 3
- 1
tox.ini View File

@@ -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


+ 1
- 0
vif_plug_linux_bridge/iptables.py View File

@@ -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()




+ 5
- 5
vif_plug_ovs/linux_net.py View File

@@ -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


Loading…
Cancel
Save