Fix pep8 errors

Recent pep8 upgrade and corresponding pycodestyle update break
pep8 job due to the new rules.

This commit fixes the following new errors:
- E266 too many leading '#' for block comment
- E501 line too long
- H903  Windows style line endings not allowed in code

The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- E731 do not assign a lambda expression, use a def
- W503 line break before binary operator

Change-Id: I1fd3357479bb2ba3d89de92739ffac99900761b6
This commit is contained in:
Akihiro Motoki 2018-04-11 00:47:20 +09:00
parent db8ecdd125
commit 7a714aeb13
5 changed files with 183 additions and 178 deletions

View File

@ -35,9 +35,9 @@ NONEXISTENT_PEER = 'nonexistent-peer'
TUNNEL_NETWORK_TYPES = [p_const.TYPE_GRE, p_const.TYPE_VXLAN,
p_const.TYPE_GENEVE]
### OpenFlow table IDs
# --- OpenFlow table IDs
## Integration bridge (int_br)
# --- Integration bridge (int_br)
LOCAL_SWITCHING = 0
@ -76,7 +76,7 @@ ACCEPTED_EGRESS_TRAFFIC_TABLE = 91
ACCEPTED_INGRESS_TRAFFIC_TABLE = 92
DROPPED_TRAFFIC_TABLE = 93
## Tunnel bridge (tun_br)
# --- Tunnel bridge (tun_br)
# Various tables for tunneling flows
DVR_PROCESS = 1
@ -91,14 +91,14 @@ UCAST_TO_TUN = 20
ARP_RESPONDER = 21
FLOOD_TO_TUN = 22
## Physical Bridges (phys_brs)
# --- Physical Bridges (phys_brs)
# Various tables for DVR use of physical bridge flows
DVR_PROCESS_VLAN = 1
LOCAL_VLAN_TRANSLATION = 2
DVR_NOT_LEARN_VLAN = 3
### end of OpenFlow table IDs
# --- end of OpenFlow table IDs
# type for ARP reply in ARP header
ARP_REPLY = '0x2'

View File

@ -387,7 +387,8 @@ class TestLinuxBridgeManager(base.BaseTestCase):
de_fn.return_value = False
vxlan_dev = FakeIpDevice()
with mock.patch.object(vxlan_dev, 'disable_ipv6') as dv6_fn,\
mock.patch.object(vxlan_dev.link, 'set_mtu') as set_mtu_fn,\
mock.patch.object(vxlan_dev.link,
'set_mtu') as set_mtu_fn,\
mock.patch.object(ip_lib, 'get_device_mtu',
return_value=physical_mtu),\
mock.patch.object(self.lbm.ip, 'add_vxlan',

View File

@ -145,7 +145,11 @@ commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
# TODO(ihrachys) figure out what to do with N534 and N536
# N534 Untranslated exception message
# N536 Use assertIsNone rather than assertEqual to check for None values
ignore = E125,E126,E128,E129,E265,H404,H405,N530,N534,N536
# TODO(amotoki) check the following new rules should be fixed or ignored
# E402 module level import not at top of file
# E731 do not assign a lambda expression, use a def
# W503 line break before binary operator
ignore = E125,E126,E128,E129,E265,E402,E731,W503,H404,H405,N530,N534,N536
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality