From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id DC8601B137 for ; Wed, 10 Oct 2018 06:09:41 +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 w9A49djr013883; Wed, 10 Oct 2018 13:09:39 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id D503AEA75CE; Wed, 10 Oct 2018 13:09:39 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id C32EFEA75C1; Wed, 10 Oct 2018 13:09:39 +0900 (JST) Received: from [IPv6:::1] (watercress.nslab.ecl.ntt.co.jp [129.60.13.73]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id B13D7400321; Wed, 10 Oct 2018 13:09:39 +0900 (JST) References: <20181009105324.42757-1-ogawa.yasufumi@lab.ntt.co.jp> <20181010062604.2DFE.277DD91C@valinux.co.jp> From: Yasufumi Ogawa Message-ID: <4f859686-1ad8-2c59-2fe5-5a49b71687bb@lab.ntt.co.jp> Date: Wed, 10 Oct 2018 13:07:31 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20181010062604.2DFE.277DD91C@valinux.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Itsuro ODA Cc: spp@dpdk.org, ferruh.yigit@intel.com X-TM-AS-MML: disable 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: Wed, 10 Oct 2018 04:09:44 -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. It is my fault, not needed anymore. Thanks for reviewing! > >> - 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. >