From b624e6369bc8d6b7ec42b5c491c764c9e799a17a Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Tue, 2 Oct 2012 19:33:57 +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 Signed-off-by: FUJITA Tomonori --- 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 6832e519..eee75b2b 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))