Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH] spp-ctl: update to return primary status
@ 2018-10-09 10:53 ogawa.yasufumi
  2018-10-09 21:26 ` Itsuro ODA
  2018-10-11 10:40 ` [spp] [PATCH v2] " ogawa.yasufumi
  0 siblings, 2 replies; 4+ messages in thread
From: ogawa.yasufumi @ 2018-10-09 10:53 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 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.
-        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [spp] [PATCH] spp-ctl: update to return primary status
  2018-10-09 10:53 [spp] [PATCH] spp-ctl: update to return primary status ogawa.yasufumi
@ 2018-10-09 21:26 ` Itsuro ODA
  2018-10-10  4:07   ` Yasufumi Ogawa
  2018-10-11 10:40 ` [spp] [PATCH v2] " ogawa.yasufumi
  1 sibling, 1 reply; 4+ messages in thread
From: Itsuro ODA @ 2018-10-09 21:26 UTC (permalink / raw)
  To: ogawa.yasufumi; +Cc: spp, ferruh.yigit

Hi Yasufumi,

On Tue,  9 Oct 2018 19:53:24 +0900
ogawa.yasufumi@lab.ntt.co.jp wrote:

> From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
> 
> 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 <ogawa.yasufumi@lab.ntt.co.jp>
> ---
>  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 <oda@valinux.co.jp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [spp] [PATCH] spp-ctl: update to return primary status
  2018-10-09 21:26 ` Itsuro ODA
@ 2018-10-10  4:07   ` Yasufumi Ogawa
  0 siblings, 0 replies; 4+ messages in thread
From: Yasufumi Ogawa @ 2018-10-10  4:07 UTC (permalink / raw)
  To: Itsuro ODA; +Cc: spp, ferruh.yigit

> Hi Yasufumi,
> 
> On Tue,  9 Oct 2018 19:53:24 +0900
> ogawa.yasufumi@lab.ntt.co.jp wrote:
> 
>> From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
>>
>> 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 <ogawa.yasufumi@lab.ntt.co.jp>
>> ---
>>   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.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [spp] [PATCH v2] spp-ctl: update to return primary status
  2018-10-09 10:53 [spp] [PATCH] spp-ctl: update to return primary status ogawa.yasufumi
  2018-10-09 21:26 ` Itsuro ODA
@ 2018-10-11 10:40 ` ogawa.yasufumi
  1 sibling, 0 replies; 4+ messages in thread
From: ogawa.yasufumi @ 2018-10-11 10:40 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/spp-ctl/spp_webapi.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/spp-ctl/spp_webapi.py b/src/spp-ctl/spp_webapi.py
index c81d0b7..6768aed 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:
@@ -398,10 +397,12 @@ class V1PrimaryHandler(BaseHandler):
         return proc
 
     def convert_status(self, data):
-        # no data returned at the moment.
-        # some data will be returned when the primary becomes to
-        # return statistical information.
-        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-11 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 10:53 [spp] [PATCH] spp-ctl: update to return primary status ogawa.yasufumi
2018-10-09 21:26 ` Itsuro ODA
2018-10-10  4:07   ` Yasufumi Ogawa
2018-10-11 10:40 ` [spp] [PATCH v2] " ogawa.yasufumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).