This resolves the following flake8 error types: F841 local variable 'e' is assigned to but never used F401 'exceptions' imported but unused
Signed-off-by: Russell Bryant <russ...@ovn.org> Acked-by: Ben Pfaff <b...@ovn.org> --- Makefile.am | 2 +- debian/ovs-monitor-ipsec | 1 - python/ovs/socket_util.py | 13 +++---------- python/ovs/unixctl/client.py | 2 -- python/ovstest/vswitch.py | 3 --- tests/test-daemon.py | 1 - tests/test-ovsdb.py | 1 - vtep/ovs-vtep | 2 +- xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 2 -- 9 files changed, 5 insertions(+), 22 deletions(-) diff --git a/Makefile.am b/Makefile.am index 52db244..50999e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -343,7 +343,7 @@ endif if HAVE_FLAKE8 ALL_LOCAL += flake8-check flake8-check: $(FLAKE8_PYFILES) - $(AM_V_GEN) if flake8 $^ --ignore=E111,E112,E113,E123,E126,E127,E128,E129,E131,E201,E203,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E302,E303,E501,E502,E703,E711,E713,E721,F401,F811,F821,F841,W601 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi + $(AM_V_GEN) if flake8 $^ --ignore=E111,E112,E113,E123,E126,E127,E128,E129,E131,E201,E203,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E302,E303,E501,E502,E703,E711,E713,E721,F811,F821,W601 ${FLAKE8_FLAGS}; then touch $@; else exit 1; fi endif include $(srcdir)/manpages.mk diff --git a/debian/ovs-monitor-ipsec b/debian/ovs-monitor-ipsec index d35ec46..50b3013 100755 --- a/debian/ovs-monitor-ipsec +++ b/debian/ovs-monitor-ipsec @@ -33,7 +33,6 @@ import sys import ovs.dirs from ovs.db import error -from ovs.db import types import ovs.util import ovs.daemon import ovs.db.idl diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py index f657d11..04fb6af 100644 --- a/python/ovs/socket_util.py +++ b/python/ovs/socket_util.py @@ -16,7 +16,6 @@ import errno import os import os.path import random -import select import socket import sys @@ -300,14 +299,8 @@ def set_dscp(sock, family, dscp): val = dscp << 2 if family == socket.AF_INET: - try: - sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, val) - except socket.error, e: - raise + sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, val) elif family == socket.AF_INET6: - try: - sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_TCLASS, val) - except socket.error, e: - raise + sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_TCLASS, val) else: - raise + raise ValueError('Invalid family %d' % family) diff --git a/python/ovs/unixctl/client.py b/python/ovs/unixctl/client.py index 2176009..be6dee4 100644 --- a/python/ovs/unixctl/client.py +++ b/python/ovs/unixctl/client.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy -import errno import os import types diff --git a/python/ovstest/vswitch.py b/python/ovstest/vswitch.py index dd315e5..be66a2e 100644 --- a/python/ovstest/vswitch.py +++ b/python/ovstest/vswitch.py @@ -15,9 +15,6 @@ """ vswitch module allows its callers to interact with OVS DB. """ -import exceptions -import subprocess - import util diff --git a/tests/test-daemon.py b/tests/test-daemon.py index b759cf9..63c1f70 100644 --- a/tests/test-daemon.py +++ b/tests/test-daemon.py @@ -13,7 +13,6 @@ # limitations under the License. import argparse -import logging import signal import sys import time diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py index a6897f3..6ddc6b4 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -389,7 +389,6 @@ def idl_set(idl, commands, step): def do_idl(schema_file, remote, *commands): schema_helper = ovs.db.idl.SchemaHelper(schema_file) if commands and commands[0].startswith("?"): - monitor = {} readonly = {} for x in commands[0][1:].split("?"): readonly = [] diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep index 3244520..9b6799e 100755 --- a/vtep/ovs-vtep +++ b/vtep/ovs-vtep @@ -641,7 +641,7 @@ def setup(): for port in bfd_ports: remote_ip = ovs_vsctl("get interface %s options:remote_ip" % port) - tunnel = destroy_vtep_tunnel(remote_ip) + destroy_vtep_tunnel(remote_ip) ovs_vsctl("del-br %s" % br) diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync index f5c38be..cb1f175 100755 --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync @@ -30,8 +30,6 @@ import time import XenAPI import ovs.dirs -from ovs.db import error -from ovs.db import types import ovs.daemon import ovs.db.idl import ovs.unixctl -- 2.5.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev