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=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 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

Patch

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