diff mbox series

[ovs-dev] ovs-save: Get highest ofp version error.

Message ID 202204181601289507739@chinatelecom.cn
State Superseded
Headers show
Series [ovs-dev] ovs-save: Get highest ofp version error. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Han Ding April 18, 2022, 8:01 a.m. UTC
When setting just one ofp version to protocols of bridge, The function
get_highest_ofp_version in ovs-save parse it error.

For example:
$ ovs-vsctl get bridge br-int protocols
[OpenFlow15]

$ ovs-vsctl get bridge br-int protocols |
  sed 's/[][]//g' | sed 's/\ //g' | awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
OpenFlow14

Signed-off-by: handing <handing@chinatelecom.cn>
---
 utilities/ovs-save | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.27.0




handing@chinatelecom.cn

Comments

Adrián Moreno May 6, 2022, 9:04 a.m. UTC | #1
Hello,

On 4/18/22 10:01, handing wrote:
> 
> When setting just one ofp version to protocols of bridge, The function
> get_highest_ofp_version in ovs-save parse it error.
> 
> For example:
> $ ovs-vsctl get bridge br-int protocols
> [OpenFlow15]
> 
> $ ovs-vsctl get bridge br-int protocols |
>    sed 's/[][]//g' | sed 's/\ //g' | awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
> OpenFlow14
> 
> Signed-off-by: handing <handing@chinatelecom.cn>

I think we need the full name of the author in the Signed-off-by tag as per

> ---
>   utilities/ovs-save | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utilities/ovs-save b/utilities/ovs-save
> index fb2025b76..a190902f4 100755
> --- a/utilities/ovs-save
> +++ b/utilities/ovs-save
> @@ -102,7 +102,7 @@ save_interfaces () {
>   get_highest_ofp_version() {
>       ovs-vsctl get bridge "$1" protocols | \
>           sed 's/[][]//g' | sed 's/\ //g' | \
> -            awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
> +            awk -F ',' '{ print (NF>0)? $(NF) : "OpenFlow14" }'
>   }
> 
>   save_flows () {
> --
> 2.27.0
> 
> 

The change itself looks good to me. Apart from the formal comment above:

Acked-by: Adrian Moreno <amorenoz@redhat.com>
Adrián Moreno May 11, 2022, 5:29 a.m. UTC | #2
On 5/6/22 11:04, Adrian Moreno wrote:
> Hello,
> 
> On 4/18/22 10:01, handing wrote:
>>
>> When setting just one ofp version to protocols of bridge, The function
>> get_highest_ofp_version in ovs-save parse it error.
>>
>> For example:
>> $ ovs-vsctl get bridge br-int protocols
>> [OpenFlow15]
>>
>> $ ovs-vsctl get bridge br-int protocols |
>>    sed 's/[][]//g' | sed 's/\ //g' | awk -F ',' '{ print (NF>1)? $(NF) : 
>> "OpenFlow14" }'
>> OpenFlow14
>>
>> Signed-off-by: handing <handing@chinatelecom.cn>
> 
> I think we need the full name of the author in the Signed-off-by tag as per

Sorry: unfinished sentence. My intention was to reference this doc: 
https://docs.openvswitch.org/en/latest/internals/contributing/submitting-patches/

> 
>> ---
>>   utilities/ovs-save | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/utilities/ovs-save b/utilities/ovs-save
>> index fb2025b76..a190902f4 100755
>> --- a/utilities/ovs-save
>> +++ b/utilities/ovs-save
>> @@ -102,7 +102,7 @@ save_interfaces () {
>>   get_highest_ofp_version() {
>>       ovs-vsctl get bridge "$1" protocols | \
>>           sed 's/[][]//g' | sed 's/\ //g' | \
>> -            awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
>> +            awk -F ',' '{ print (NF>0)? $(NF) : "OpenFlow14" }'
>>   }
>>
>>   save_flows () {
>> -- 
>> 2.27.0
>>
>>
> 
> The change itself looks good to me. Apart from the formal comment above:
> 
> Acked-by: Adrian Moreno <amorenoz@redhat.com>
>
Han Ding May 11, 2022, 5:41 a.m. UTC | #3
--------------



Han Ding
>
>
>On 5/6/22 11:04, Adrian Moreno wrote:
>> Hello,
>> 
>> On 4/18/22 10:01, handing wrote:
>>>
>>> When setting just one ofp version to protocols of bridge, The function
>>> get_highest_ofp_version in ovs-save parse it error.
>>>
>>> For example:
>>> $ ovs-vsctl get bridge br-int protocols
>>> [OpenFlow15]
>>>
>>> $ ovs-vsctl get bridge br-int protocols |
>>>    sed 's/[][]//g' | sed 's/\ //g' | awk -F ',' '{ print (NF>1)? $(NF) : 
>>> "OpenFlow14" }'
>>> OpenFlow14
>>>
>>> Signed-off-by: handing <handing@chinatelecom.cn>
>> 
>> I think we need the full name of the author in the Signed-off-by tag as per
>
>Sorry: unfinished sentence. My intention was to reference this doc: 
>https://docs.openvswitch.org/en/latest/internals/contributing/submitting-patches/

Thanks for reviewing. I will modify it in next version.


>> 
>>> ---
>>>   utilities/ovs-save | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/utilities/ovs-save b/utilities/ovs-save
>>> index fb2025b76..a190902f4 100755
>>> --- a/utilities/ovs-save
>>> +++ b/utilities/ovs-save
>>> @@ -102,7 +102,7 @@ save_interfaces () {
>>>   get_highest_ofp_version() {
>>>       ovs-vsctl get bridge "$1" protocols | \
>>>           sed 's/[][]//g' | sed 's/\ //g' | \
>>> -            awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
>>> +            awk -F ',' '{ print (NF>0)? $(NF) : "OpenFlow14" }'
>>>   }
>>>
>>>   save_flows () {
>>> -- 
>>> 2.27.0
>>>
>>>
>> 
>> The change itself looks good to me. Apart from the formal comment above:
>> 
>> Acked-by: Adrian Moreno <amorenoz@redhat.com>
>> 
>
>-- 
>Adrián Moreno
>
diff mbox series

Patch

diff --git a/utilities/ovs-save b/utilities/ovs-save
index fb2025b76..a190902f4 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -102,7 +102,7 @@  save_interfaces () {
 get_highest_ofp_version() {
     ovs-vsctl get bridge "$1" protocols | \
         sed 's/[][]//g' | sed 's/\ //g' | \
-            awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }'
+            awk -F ',' '{ print (NF>0)? $(NF) : "OpenFlow14" }'
 }

 save_flows () {