python: Remove unused imports and variables.
authorRussell Bryant <russell@ovn.org>
Tue, 22 Dec 2015 15:43:24 +0000 (10:43 -0500)
committerRussell Bryant <russell@ovn.org>
Tue, 5 Jan 2016 23:13:47 +0000 (18:13 -0500)
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 <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Makefile.am
debian/ovs-monitor-ipsec
python/ovs/socket_util.py
python/ovs/unixctl/client.py
python/ovstest/vswitch.py
tests/test-daemon.py
tests/test-ovsdb.py
vtep/ovs-vtep
xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync

index 52db244..50999e5 100644 (file)
@@ -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
index d35ec46..50b3013 100755 (executable)
@@ -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
index f657d11..04fb6af 100644 (file)
@@ -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)
index 2176009..be6dee4 100644 (file)
@@ -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
 
index dd315e5..be66a2e 100644 (file)
@@ -15,9 +15,6 @@
 """
 vswitch module allows its callers to interact with OVS DB.
 """
-import exceptions
-import subprocess
-
 import util
 
 
index b759cf9..63c1f70 100644 (file)
@@ -13,7 +13,6 @@
 # limitations under the License.
 
 import argparse
-import logging
 import signal
 import sys
 import time
index a6897f3..6ddc6b4 100644 (file)
@@ -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 = []
index 3244520..9b6799e 100755 (executable)
@@ -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)
 
index f5c38be..cb1f175 100755 (executable)
@@ -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