diff mbox series

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

Message ID 1523831959-11809-1-git-send-email-aginwala@ebay.com
State Superseded
Headers show
Series [ovs-dev,v2] ovn-ctl: Handle whitespaces when using eval for start_ovsdb: | expand

Commit Message

aginwala aginwala April 15, 2018, 10:39 p.m. UTC
eval doesn't understand white space for local var which was introduced in commit
79c7961b8b3c4b7ea0251dea2ffacfa84c84fecb for starting clustered ovn dbs.
As ovn-ctl uses sh instead of bash, parsing local var with white space will fail.

e.g. /usr/share/openvswitch/scripts/ovn-ctl --db-nb-addr= --db-nb-create-insecure-remote=yes \
     --db-sb-addr= --db-sb-create-insecure-remote=yes \
     --db-nb-cluster-local-addr= \
     --db-sb-cluster-local-addr= \
     --ovn-northd-nb-db=tcp:,tcp:,tcp: \
     --ovn-northd-sb-db=tcp:,tcp:,tcp: \

gives error: /usr/share/openvswitch/scripts/ovn-ctl: 1: local: -vfile:info: bad variable name

As a result ovsdb fails to even initialize and start. Hence, we need to remove
local keyword for log variable to make it work with both sh and bash.

Signed-off-by: aginwala <aginwala@ebay.com>
 ovn/utilities/ovn-ctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 25dda52..43b1675 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -108,7 +108,7 @@  start_ovsdb__() {
     eval local file=\$DB_${DB}_FILE
     eval local schema=\$DB_${DB}_SCHEMA
     eval local logfile=\$OVN_${DB}_LOGFILE
-    eval local log=\$OVN_${DB}_LOG
+    eval log=\$OVN_${DB}_LOG
     eval local sock=\$DB_${DB}_SOCK
     eval local detach=\$DB_${DB}_DETACH
     eval local create_insecure_remote=\$DB_${DB}_CREATE_INSECURE_REMOTE