diff mbox series

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

Message ID 2022051116533703815815@chinatelecom.cn
State Accepted
Commit 8ce7ead8cf5c997371f3371a3d7eb8520a72c9cb
Headers show
Series [ovs-dev,v2] 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 May 11, 2022, 8:53 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: Han Ding <handing@chinatelecom.cn>
Acked-by: Adrian Moreno <amorenoz@redhat.com>
---

Notes:
    Change the author name to full name.

 utilities/ovs-save | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.27.0

Comments

Ilya Maximets May 18, 2022, 10:33 a.m. UTC | #1
On 5/11/22 10:53, Han Ding 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: Han Ding <handing@chinatelecom.cn>
> Acked-by: Adrian Moreno <amorenoz@redhat.com>
> ---
> 
> Notes:
>     Change the author name to full name.
> 
>  utilities/ovs-save | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied.  Thanks!
Backported down to 2.16.

Best regards, Ilya Maximets.
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 () {