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

aginwala amginwal at gmail.com
Sun Apr 15 22:39:19 UTC 2018


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 at ebay.com>
---
 ovn/utilities/ovn-ctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the dev mailing list