From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.valinux.co.jp (mail.valinux.co.jp [210.128.90.3]) by dpdk.org (Postfix) with ESMTP id 299241B1D9 for ; Tue, 9 Oct 2018 23:26:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.valinux.co.jp (Postfix) with ESMTP id 7E9C3B3E7D; Wed, 10 Oct 2018 06:26:05 +0900 (JST) X-Virus-Scanned: Debian amavisd-new at valinux.co.jp Received: from mail.valinux.co.jp ([127.0.0.1]) by localhost (mail.valinux.co.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KmWPv9hK35O7; Wed, 10 Oct 2018 06:26:05 +0900 (JST) Received: from [127.0.0.1] (vagw.valinux.co.jp [210.128.90.14]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.valinux.co.jp (Postfix) with ESMTPS id 648C3B3E37; Wed, 10 Oct 2018 06:26:05 +0900 (JST) Date: Wed, 10 Oct 2018 06:26:04 +0900 From: Itsuro ODA To: ogawa.yasufumi@lab.ntt.co.jp Cc: spp@dpdk.org, ferruh.yigit@intel.com In-Reply-To: <20181009105324.42757-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181009105324.42757-1-ogawa.yasufumi@lab.ntt.co.jp> Message-Id: <20181010062604.2DFE.277DD91C@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.71.01 [ja] Subject: Re: [spp] [PATCH] spp-ctl: update to return primary status 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, 09 Oct 2018 21:26:07 -0000 Hi Yasufumi, On Tue, 9 Oct 2018 19:53:24 +0900 ogawa.yasufumi@lab.ntt.co.jp wrote: > From: Yasufumi Ogawa > > Status command of primary is changed to return statistics of each of > ports. This update is to change spp-ctl to return the reponse. > > Signed-off-by: Yasufumi Ogawa > --- > src/spp-ctl/spp_webapi.py | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/spp-ctl/spp_webapi.py b/src/spp-ctl/spp_webapi.py > index 9c16af6..dd595a0 100644 > --- a/src/spp-ctl/spp_webapi.py > +++ b/src/spp-ctl/spp_webapi.py > @@ -325,7 +325,6 @@ class V1NFVHandler(BaseHandler): > # that it has no dst port. > # {"status":"idling","ports":[{"src":"phy:0","dst":"null"},... > > - # TODO(yasufum) modify after nfv and vm is updated for new data definition. > try: > nfv = json.loads(data) > except json.JSONDecodeError as e: > @@ -402,7 +401,12 @@ class V1PrimaryHandler(BaseHandler): > # no data returned at the moment. > # some data will be returned when the primary becomes to > # return statistical information. These comment lines should be removed at the same time because its aim is to explain why no data returned and it is not necessary now. > - return {} > + stat = {} > + try: > + stat = json.loads(data) > + except json.JSONDecodeError as e: > + print("%s" % e) > + return stat > > def get_status(self): > proc = self._get_proc() > -- > 2.7.4 Thanks. -- Itsuro ODA