In openvswitch e76f8472090e ("ovsdb-server: Database config isolation."),
sync-status has changed the output sequence of bachup node as:

$ ovn-appctl -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/sync-status
database: OVN_Northbound
state: backup
replicating: tcp:hostname:6641

Fix sync_status by matching the state field.

Signed-off-by: Tao Liu <taoliu...@163.com>
---
 utilities/ovn-ctl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl
index 23deaa072..acbeacd09 100755
--- a/utilities/ovn-ctl
+++ b/utilities/ovn-ctl
@@ -446,7 +446,8 @@ start_ic_ovsdb () {
 
 sync_status() {
     local ctl_file=$1
-    ovn-appctl -t $ctl_file ovsdb-server/sync-status | awk '{if(NR==1) print 
$2}'
+    ovn-appctl -t $ctl_file ovsdb-server/sync-status | \
+                  awk '/state:/ {print $2; exit}'
 }
 
 status_ovnnb() {
-- 
2.31.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to