[ovs-dev] [PATCH] stream.py: Don't use class decorators.

Isaku Yamahata yamahata at valinux.co.jp
Wed Oct 17 18:09:02 UTC 2012


Hi. The patch looks reasonable.

If it isn't used as decorator, returning class is not necessary.
I'll send a patch to fix it.


On Wed, Oct 17, 2012 at 10:04:49AM -0700, Justin Pettit wrote:
> I went ahead and pushed the change, since it was blocking our internal testing.  Please let me know if you object to the patch, and we can work on a revised version.
> 
> --Justin
> 
> 
> On Oct 17, 2012, at 1:28 AM, Justin Pettit <jpettit at nicira.com> wrote:
> 
> > Hi, Isaku.  Can you confirm that this change looks reasonable to you?  If so, I'll go ahead and push it.
> > 
> > Thanks,
> > 
> > --Justin
> > 
> > 
> > On Oct 16, 2012, at 5:36 PM, Reid Price <reid at nicira.com> wrote:
> > 
> >> Thanks Justin!
> >> 
> >> Signed-off-by:  Reid Price <reid at nicira.com>
> >> 
> >> On Tue, Oct 16, 2012 at 5:29 PM, Justin Pettit <jpettit at nicira.com> wrote:
> >>> Commit 8cc820 (python/ovs/stream: teach stream.py tcp socket) made a
> >>> change that used class decorators.  Unfortunately, they were not
> >>> introduced until Python 2.6.  XenServer uses Python 2.4, so the change
> >>> caused some Python-based daemons not to start.  This commit uses an
> >>> alternate syntax suggested by Reid Price.
> >>> 
> >>> Bug #13580
> >>> 
> >>> Signed-off-by: Justin Pettit <jpettit at nicira.com>
> >>> ---
> >>> python/ovs/stream.py |    4 ++--
> >>> 1 files changed, 2 insertions(+), 2 deletions(-)
> >>> 
> >>> diff --git a/python/ovs/stream.py b/python/ovs/stream.py
> >>> index 8cc8202..6bd0ccb 100644
> >>> --- a/python/ovs/stream.py
> >>> +++ b/python/ovs/stream.py
> >>> @@ -344,16 +344,15 @@ Passive %s connection methods:
> >>>  punix:FILE              Listen on Unix domain socket FILE""" % (name, name)
> >>> 
> >>> 
> >>> - at Stream.register_method("unix")
> >>> class UnixStream(Stream):
> >>>    @staticmethod
> >>>    def _open(suffix, dscp):
> >>>        connect_path = suffix
> >>>        return  ovs.socket_util.make_unix_socket(socket.SOCK_STREAM,
> >>>                                                 True, None, connect_path)
> >>> +UnixStream = Stream.register_method("unix")(UnixStream)
> >>> 
> >>> 
> >>> - at Stream.register_method("tcp")
> >>> class TCPStream(Stream):
> >>>    @staticmethod
> >>>    def _open(suffix, dscp):
> >>> @@ -362,3 +361,4 @@ class TCPStream(Stream):
> >>>        if not error:
> >>>            sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
> >>>        return error, sock
> >>> +TCPStream = Stream.register_method("tcp")(TCPStream)
> >>> --
> >>> 1.7.5.4
> >>> 
> >>> _______________________________________________
> >>> dev mailing list
> >>> dev at openvswitch.org
> >>> http://openvswitch.org/mailman/listinfo/dev
> > 
> 

-- 
yamahata



More information about the dev mailing list