From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0807.ocn.ad.jp (mogw0807.ocn.ad.jp [153.149.234.8]) by dpdk.org (Postfix) with ESMTP id C52941E974 for ; Tue, 12 Jun 2018 09:03:32 +0200 (CEST) Received: from mf-smf-ucb034c1 (mf-smf-ucb034c1.ocn.ad.jp [153.153.66.227]) by mogw0807.ocn.ad.jp (Postfix) with ESMTP id 21A5EA0047A; Tue, 12 Jun 2018 16:03:31 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb027 ([153.149.142.101]) by mf-smf-ucb034c1 with ESMTP id SdKwftVgtXu2NSdL1fkm9c; Tue, 12 Jun 2018 16:03:31 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.166]) by ntt.pod01.mv-mta-ucb027 with id xj3X1x0033c2f7501j3XTB; Tue, 12 Jun 2018 07:03:31 +0000 Received: from localhost.localdomain (p5164-ipngn8501marunouchi.tokyo.ocn.ne.jp [153.214.228.164]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Tue, 12 Jun 2018 16:03:31 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org Cc: Yasufumi Ogawa Date: Tue, 12 Jun 2018 16:03:16 +0900 Message-Id: <20180612070316.5261-3-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612070316.5261-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20180612070316.5261-1-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 2/2] controller: fix encoding in topo command X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:03:33 -0000 From: Yasufumi Ogawa For python3, it is required to treat str and bytes explicitly for sending and receiving messages via socket. This update is for encoding messages to 'utf-8' similar to previous commit '7c5193f'. Signed-off-by: Yasufumi Ogawa --- src/controller/topo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controller/topo.py b/src/controller/topo.py index d578290..e608961 100644 --- a/src/controller/topo.py +++ b/src/controller/topo.py @@ -32,7 +32,8 @@ class Topo(object): def show(self, dtype, size): res_ary = [] for sec_id in self.sec_ids: - self.m2s_queues[sec_id].put("status") + msg = "status" + self.m2s_queues[sec_id].put(msg.encode('utf-8')) res = self.format_sec_status( sec_id, self.s2m_queues[sec_id].get(True)) res_ary.append(res) @@ -47,7 +48,8 @@ class Topo(object): def output(self, fname, ftype="dot"): res_ary = [] for sec_id in self.sec_ids: - self.m2s_queues[sec_id].put("status") + msg = "status" + self.m2s_queues[sec_id].put(msg.encode('utf-8')) res = self.format_sec_status( sec_id, self.s2m_queues[sec_id].get(True)) res_ary.append(res) @@ -266,7 +268,6 @@ class Topo(object): from distutils import spawn # TODO(yasufum) Add check for using only supported terminal - if spawn.find_executable("img2sixel") is not None: img_cmd = "img2sixel" else: -- 2.17.1