Prepare for porting unix sockets to Windows named-pipes. Signed-off-by: Paul-Daniel Boca <pb...@cloudbasesolutions.com> --- python/automake.mk | 2 +- python/ovs/jsonrpc.py | 14 +++++++------- python/ovs/{stream.py => stream_unix.py} | 0 python/ovs/unixctl/client.py | 6 +++--- python/ovs/unixctl/server.py | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) rename python/ovs/{stream.py => stream_unix.py} (100%)
diff --git a/python/automake.mk b/python/automake.mk index 1c8fa38..3fe9519 100644 --- a/python/automake.mk +++ b/python/automake.mk @@ -27,7 +27,7 @@ ovs_pyfiles = \ python/ovs/process.py \ python/ovs/reconnect.py \ python/ovs/socket_util.py \ - python/ovs/stream.py \ + python/ovs/stream_unix.py \ python/ovs/timeval.py \ python/ovs/unixctl/__init__.py \ python/ovs/unixctl/client.py \ diff --git a/python/ovs/jsonrpc.py b/python/ovs/jsonrpc.py index 6300c67..8ca01a0 100644 --- a/python/ovs/jsonrpc.py +++ b/python/ovs/jsonrpc.py @@ -20,7 +20,7 @@ import six import ovs.json import ovs.poller import ovs.reconnect -import ovs.stream +import ovs.stream_unix as ovs_stream import ovs.timeval import ovs.util import ovs.vlog @@ -372,8 +372,8 @@ class Session(object): @staticmethod def open(name): """Creates and returns a Session that maintains a JSON-RPC session to - 'name', which should be a string acceptable to ovs.stream.Stream or - ovs.stream.PassiveStream's initializer. + 'name', which should be a string acceptable to ovs_stream.Stream or + ovs_stream.PassiveStream's initializer. If 'name' is an active connection method, e.g. "tcp:127.1.2.3", the new session connects and reconnects, with back-off, to 'name'. @@ -386,10 +386,10 @@ class Session(object): reconnect.set_name(name) reconnect.enable(ovs.timeval.msec()) - if ovs.stream.PassiveStream.is_valid_name(name): + if ovs_stream.PassiveStream.is_valid_name(name): reconnect.set_passive(True, ovs.timeval.msec()) - if not ovs.stream.stream_or_pstream_needs_probes(name): + if not ovs_stream.stream_or_pstream_needs_probes(name): reconnect.set_probe_interval(0) return Session(reconnect, None) @@ -430,13 +430,13 @@ class Session(object): name = self.reconnect.get_name() if not self.reconnect.is_passive(): - error, self.stream = ovs.stream.Stream.open(name) + error, self.stream = ovs_stream.Stream.open(name) if not error: self.reconnect.connecting(ovs.timeval.msec()) else: self.reconnect.connect_failed(ovs.timeval.msec(), error) elif self.pstream is None: - error, self.pstream = ovs.stream.PassiveStream.open(name) + error, self.pstream = ovs_stream.PassiveStream.open(name) if not error: self.reconnect.listening(ovs.timeval.msec()) else: diff --git a/python/ovs/stream.py b/python/ovs/stream_unix.py similarity index 100% rename from python/ovs/stream.py rename to python/ovs/stream_unix.py diff --git a/python/ovs/unixctl/client.py b/python/ovs/unixctl/client.py index 1b247c4..fde674e 100644 --- a/python/ovs/unixctl/client.py +++ b/python/ovs/unixctl/client.py @@ -17,7 +17,7 @@ import os import six import ovs.jsonrpc -import ovs.stream +import ovs.stream_unix as ovs_stream import ovs.util @@ -59,8 +59,8 @@ class UnixctlClient(object): assert isinstance(path, str) unix = "unix:%s" % ovs.util.abs_file_name(ovs.dirs.RUNDIR, path) - error, stream = ovs.stream.Stream.open_block( - ovs.stream.Stream.open(unix)) + error, stream = ovs_stream.Stream.open_block( + ovs_stream.Stream.open(unix)) if error: vlog.warn("failed to connect to %s" % path) diff --git a/python/ovs/unixctl/server.py b/python/ovs/unixctl/server.py index 8595ed8..50a11d4 100644 --- a/python/ovs/unixctl/server.py +++ b/python/ovs/unixctl/server.py @@ -22,7 +22,7 @@ from six.moves import range import ovs.dirs import ovs.jsonrpc -import ovs.stream +import ovs.stream_unix as ovs_stream import ovs.unixctl import ovs.util import ovs.version @@ -141,7 +141,7 @@ def _unixctl_version(conn, unused_argv, version): class UnixctlServer(object): def __init__(self, listener): - assert isinstance(listener, ovs.stream.PassiveStream) + assert isinstance(listener, ovs_stream.PassiveStream) self._listener = listener self._conns = [] @@ -200,7 +200,7 @@ class UnixctlServer(object): if version is None: version = ovs.version.VERSION - error, listener = ovs.stream.PassiveStream.open(path) + error, listener = ovs_stream.PassiveStream.open(path) if error: ovs.util.ovs_error(error, "could not initialize control socket %s" % path) @@ -246,8 +246,8 @@ class UnixctlClient(object): assert isinstance(path, str) unix = "unix:%s" % ovs.util.abs_file_name(ovs.dirs.RUNDIR, path) - error, stream = ovs.stream.Stream.open_block( - ovs.stream.Stream.open(unix)) + error, stream = ovs_stream.Stream.open_block( + ovs_stream.Stream.open(unix)) if error: vlog.warn("failed to connect to %s" % path) -- 2.7.2.windows.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev