On Tue, Oct 02, 2012 at 04:20:13PM +0900, FUJITA Tomonori wrote:
> On Tue,  2 Oct 2012 16:01:00 +0900
> Isaku Yamahata <[email protected]> wrote:
> 
> > Printing raw string causes terminal in unexpected mode.
> > 
> > Signed-off-by: Isaku Yamahata <[email protected]>
> > ---
> >  ryu/controller/ofp_handler.py |    5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py
> > index 6832e51..149d4dc 100644
> > --- a/ryu/controller/ofp_handler.py
> > +++ b/ryu/controller/ofp_handler.py
> > @@ -16,6 +16,7 @@
> >  
> >  import logging
> >  
> > +from ryu import utils
> >  from ryu.base import app_manager
> >  from ryu.controller import dispatcher
> >  from ryu.controller import ofp_event
> > @@ -98,7 +99,7 @@ class OFPHandler(app_manager.RyuApp):
> >                  [HANDSHAKE_DISPATCHER, CONFIG_DISPATCHER, MAIN_DISPATCHER])
> >      def echo_request_handler(self, ev):
> >          msg = ev.msg
> > -        # LOG.debug('echo request msg %s %s', msg, str(msg.data))
> > +        # LOG.debug('echo request msg %s %s', msg, 
> > utils.hex_array(msg.data))
> 
> Let's remove the above comment. Or comment out it. I prefer the
> former. Modifying the comment code doesn't make sense.

Here's the one where the line is eliminated.

>From 60dd31072a30f1a1293c0eda95b5ea6ecf0cab9f Mon Sep 17 00:00:00 2001
Message-Id: 
<60dd31072a30f1a1293c0eda95b5ea6ecf0cab9f.1349173983.git.yamah...@valinux.co.jp>
In-Reply-To: <[email protected]>
References: <[email protected]>
From: Isaku Yamahata <[email protected]>
Date: Tue, 2 Oct 2012 11:42:36 +0900
Subject: [PATCH] ofp_handler: print msg.data in hex format, not raw
 string

Printing raw string causes terminal in unexpected mode.

Signed-off-by: Isaku Yamahata <[email protected]>
---
 ryu/controller/ofp_handler.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py
index 6832e51..eee75b2 100644
--- a/ryu/controller/ofp_handler.py
+++ b/ryu/controller/ofp_handler.py
@@ -16,6 +16,7 @@
 
 import logging
 
+from ryu import utils
 from ryu.base import app_manager
 from ryu.controller import dispatcher
 from ryu.controller import ofp_event
@@ -98,7 +99,6 @@ class OFPHandler(app_manager.RyuApp):
                 [HANDSHAKE_DISPATCHER, CONFIG_DISPATCHER, MAIN_DISPATCHER])
     def echo_request_handler(self, ev):
         msg = ev.msg
-        # LOG.debug('echo request msg %s %s', msg, str(msg.data))
         datapath = msg.datapath
         echo_reply = datapath.ofproto_parser.OFPEchoReply(datapath)
         echo_reply.xid = msg.xid
@@ -110,4 +110,4 @@ class OFPHandler(app_manager.RyuApp):
     def error_msg_handler(self, ev):
         msg = ev.msg
         LOG.debug('error msg ev %s type 0x%x code 0x%x %s',
-                  msg, msg.type, msg.code, str(msg.data))
+                  msg, msg.type, msg.code, utils.hex_array(msg.data))
-- 
1.7.10.4
-- 
yamahata

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to