Skip to content

Commit

Permalink
python: Remove unused imports and variables.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
russellb committed Jan 5, 2016
1 parent 115d871 commit 5697ca9
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion debian/ovs-monitor-ipsec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 3 additions & 10 deletions python/ovs/socket_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import os
import os.path
import random
import select
import socket
import sys

Expand Down Expand Up @@ -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)
2 changes: 0 additions & 2 deletions python/ovs/unixctl/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions python/ovstest/vswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"""
vswitch module allows its callers to interact with OVS DB.
"""
import exceptions
import subprocess

import util


Expand Down
1 change: 0 additions & 1 deletion tests/test-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import argparse
import logging
import signal
import sys
import time
Expand Down
1 change: 0 additions & 1 deletion tests/test-ovsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ def notify(event, row, updates=None):
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 = []
Expand Down
2 changes: 1 addition & 1 deletion vtep/ovs-vtep
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5697ca9

Please sign in to comment.