Message ID | ME3PR01MB5781260BB6F47B5F86FB992DCD3E9@ME3PR01MB5781.ausprd01.prod.outlook.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] ovs-save: Fix awk command to return highest ofp version. | expand |
On Tue, Jun 01, 2021 at 12:47:19PM +0000, lin huang wrote: > The quotes for strings like "br0" had been removed.In ovs-save file > get_highest_ofp_version function still using quotes as field separator. > That is, get_highest_ofp_version() always return OpenFlow14 version string, > not the highest ofp version. > > This patch adds support for new string style to return highest ofp version. > > Signed-off-by: linhuang <linhuang@ruijie.com.cn> Thanks, I applied this to master. I changed the commit message to: ovs-save: Fix awk command to return highest ofp version. "ovs-vsctl get Bridge "$1" protocols" prints something like this: [OpenFlow12, OpenFlow13] The code in ovs-save didn't parse it properly. This fixes the problem. because I didn't understand the problem from the previous version.
diff --git a/utilities/ovs-save b/utilities/ovs-save index 7d810cb..0a70e1d 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -101,7 +101,8 @@ save_interfaces () { get_highest_ofp_version() { ovs-vsctl get bridge "$1" protocols | \ - awk -F '"' '{ print (NF>1)? $(NF-1) : "OpenFlow14" }' + sed 's/[][]//g' | sed 's/\ //g' | \ + awk -F ',' '{ print (NF>1)? $(NF) : "OpenFlow14" }' } save_flows () {
The quotes for strings like "br0" had been removed.In ovs-save file get_highest_ofp_version function still using quotes as field separator. That is, get_highest_ofp_version() always return OpenFlow14 version string, not the highest ofp version. This patch adds support for new string style to return highest ofp version. Signed-off-by: linhuang <linhuang@ruijie.com.cn> --- utilities/ovs-save | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.8.3.1