From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B5AD6A0096 for ; Wed, 8 May 2019 04:01:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87D6B2082; Wed, 8 May 2019 04:01:48 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 4F5A0DE3 for ; Wed, 8 May 2019 04:01:46 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4821jXh023003; Wed, 8 May 2019 11:01:45 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 44015EA407F; Wed, 8 May 2019 11:01:45 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 31F8BEA7089; Wed, 8 May 2019 11:01:45 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Wed, 8 May 2019 10:59:29 +0900 Message-Id: <1557280769-7569-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557280769-7569-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1557280769-7569-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 2/2] controller: update paring lcores for master 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: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa As master lcore ID is the response of status command, update parsing lcore IDs for this change. Signed-off-by: Yasufumi Ogawa --- src/controller/commands/nfv.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/controller/commands/nfv.py b/src/controller/commands/nfv.py index 2613bc2..92d2a3f 100644 --- a/src/controller/commands/nfv.py +++ b/src/controller/commands/nfv.py @@ -74,8 +74,15 @@ class SppNfv(object): """ nfv_attr = json_obj - print('- status: %s' % nfv_attr['status']) - print('- lcores: %s' % nfv_attr['lcores']) + print('- status: {}'.format(nfv_attr['status'])) + print('- lcore_ids:') + print(' - master: {}'.format(nfv_attr['master-lcore'])) + # remove master and show remained + nfv_attr['lcores'].remove(nfv_attr['master-lcore']) + if len(nfv_attr['lcores']) > 1: + print(' - slaves: {}'.format(nfv_attr['lcores'])) + else: + print(' - slave: {}'.format(nfv_attr['lcores'][0])) print('- ports:') for port in nfv_attr['ports']: dst = None @@ -84,9 +91,9 @@ class SppNfv(object): dst = patch['dst'] if dst is None: - print(' - %s' % port) + print(' - {}'.format(port)) else: - print(' - %s -> %s' % (port, dst)) + print(' - {} -> {}'.format(port, dst)) def get_ports(self): """Get all of ports as a list.""" -- 2.17.1