[ovs-dev] [PATCH] ovn-ctl: Handle whitespaces when using eval for start_ovsdb:

aginwala amginwal at gmail.com
Thu Apr 12 22:40:33 UTC 2018


eval doesn't understand white spaces which was introduced in commit
79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs

Hence, we need to explicitely handle it.
e.g. /usr/share/openvswitch/scripts/ovn-ctl --db-nb-addr=192.168.220.101 --db-nb-create-insecure-remote=yes \
    --db-sb-addr=192.168.220.101 --db-sb-create-insecure-remote=yes \
    --db-nb-cluster-local-addr=192.168.220.101 \
    --db-sb-cluster-local-addr=192.168.220.101 \
    --ovn-northd-nb-db=tcp:192.168.220.101:6641,tcp:192.168.220.102:6641,tcp:192.168.220.103:6641 \
    --ovn-northd-sb-db=tcp:192.168.220.101:6642,tcp:192.168.220.102:6642,tcp:192.168.220.103:6642 \
    start_northd

gives error: /usr/share/openvswitch/scripts/ovn-ctl: 1: local: -vfile:info: bad variable name
As a result ovsdb failes to even initialize and start. This commit fixes the same.

Signed-off-by: aginwala <aginwala at ebay.com>
---
 ovn/utilities/ovn-ctl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 25dda52..9a1ad75 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -409,8 +409,8 @@ set_defaults () {
     OVN_CONTROLLER_LOG="-vconsole:emer -vsyslog:err -vfile:info"
     OVN_NORTHD_LOG="-vconsole:emer -vsyslog:err -vfile:info"
     OVN_NORTHD_LOGFILE=""
-    OVN_NB_LOG="-vconsole:off -vfile:info"
-    OVN_SB_LOG="-vconsole:off -vfile:info"
+    OVN_NB_LOG='"-vconsole:off' '-vfile:info"'
+    OVN_SB_LOG='"-vconsole:off' '-vfile:info"'
     OVN_NB_LOGFILE="$logdir/ovsdb-server-nb.log"
     OVN_SB_LOGFILE="$logdir/ovsdb-server-sb.log"
 
-- 
1.9.1



More information about the dev mailing list