From 217101758a94d40b600fd054245f5d385a190060 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Fri, 24 Nov 2023 07:53:56 +0000 Subject: [PATCH] ovs-healthcheck: ignore error when log file does not exist Signed-off-by: zhangzujian --- dist/images/ovs-healthcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/images/ovs-healthcheck.sh b/dist/images/ovs-healthcheck.sh index 7b00540b89c..a8203b51372 100755 --- a/dist/images/ovs-healthcheck.sh +++ b/dist/images/ovs-healthcheck.sh @@ -39,7 +39,7 @@ ovn-ctl status_controller file="/var/log/ovn/ovn-controller.log" if [ -e $file ] then - result=$(tail -6 $file) + result=$(tail -6 $file 2>/dev/null || true) if [[ "$result" =~ "clustered database server has stale data" ]] then echo "check write to ovn sb db, clustered database server has stale data, run sb-cluster-state-reset command to restore"