summaryrefslogtreecommitdiff
path: root/python/ovstest
diff options
context:
space:
mode:
authorRosemarie O'Riorden <roriorde@redhat.com>2021-06-15 11:58:02 -0400
committerIlya Maximets <i.maximets@ovn.org>2021-06-22 21:29:57 +0200
commitbd9052455092630e03485538a29f9f8d147c41ca (patch)
treebd7edf0116704a50fed89ca28ee424b4b7b98498 /python/ovstest
parentad256c31407d347eb185b39cb8fefc9df607e3ed (diff)
downloadopenvswitch-bd9052455092630e03485538a29f9f8d147c41ca.tar.gz
Remove Python 2 leftovers.
Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1949875 Signed-off-by: Rosemarie O'Riorden <roriorde@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'python/ovstest')
-rw-r--r--python/ovstest/rpcserver.py14
-rw-r--r--python/ovstest/tcp.py4
-rw-r--r--python/ovstest/tests.py2
-rw-r--r--python/ovstest/util.py4
-rw-r--r--python/ovstest/vswitch.py2
5 files changed, 7 insertions, 19 deletions
diff --git a/python/ovstest/rpcserver.py b/python/ovstest/rpcserver.py
index c4aab7020..05b6b1be2 100644
--- a/python/ovstest/rpcserver.py
+++ b/python/ovstest/rpcserver.py
@@ -18,22 +18,14 @@ rpcserver is an XML RPC server that allows RPC client to initiate tests
import sys
-import exceptions
-
import xmlrpc.client
-import tcp
-
from twisted.internet import reactor
from twisted.internet.error import CannotListenError
from twisted.web import server
from twisted.web import xmlrpc
-import udp
-
-import util
-
-import vswitch
+from . import tcp, udp, util, vswitch
class TestArena(xmlrpc.XMLRPC):
@@ -210,7 +202,7 @@ class TestArena(xmlrpc.XMLRPC):
(_, port) = self.__get_handle_resources(handle)
port.loseConnection()
self.__delete_handle(handle)
- except exceptions.KeyError:
+ except KeyError:
return -1
return 0
@@ -222,7 +214,7 @@ class TestArena(xmlrpc.XMLRPC):
(_, connector) = self.__get_handle_resources(handle)
connector.disconnect()
self.__delete_handle(handle)
- except exceptions.KeyError:
+ except KeyError:
return -1
return 0
diff --git a/python/ovstest/tcp.py b/python/ovstest/tcp.py
index c495717f2..098c6cba3 100644
--- a/python/ovstest/tcp.py
+++ b/python/ovstest/tcp.py
@@ -21,7 +21,7 @@ import time
from twisted.internet import interfaces
from twisted.internet.protocol import ClientFactory, Factory, Protocol
-from zope.interface import implements
+from zope.interface.declarations import implementer
class TcpListenerConnection(Protocol):
@@ -55,8 +55,8 @@ class TcpListenerFactory(Factory):
return str(self.stats)
+@implementer(interfaces.IPushProducer)
class Producer(object):
- implements(interfaces.IPushProducer)
"""
This producer class generates infinite byte stream for a specified time
duration
diff --git a/python/ovstest/tests.py b/python/ovstest/tests.py
index 6de3cc3af..f959f945e 100644
--- a/python/ovstest/tests.py
+++ b/python/ovstest/tests.py
@@ -10,8 +10,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from __future__ import print_function
-
import math
import time
diff --git a/python/ovstest/util.py b/python/ovstest/util.py
index 72457158f..270d6a037 100644
--- a/python/ovstest/util.py
+++ b/python/ovstest/util.py
@@ -26,8 +26,6 @@ import socket
import struct
import subprocess
-import exceptions
-
import xmlrpc.client
@@ -88,7 +86,7 @@ def start_process(args):
stderr=subprocess.PIPE)
out, err = p.communicate()
return (p.returncode, out, err)
- except exceptions.OSError:
+ except OSError:
return (-1, None, None)
diff --git a/python/ovstest/vswitch.py b/python/ovstest/vswitch.py
index 9d5b5cffd..45c9587ee 100644
--- a/python/ovstest/vswitch.py
+++ b/python/ovstest/vswitch.py
@@ -15,7 +15,7 @@
"""
vswitch module allows its callers to interact with OVS DB.
"""
-import util
+from . import util
def ovs_vsctl_add_bridge(bridge):