[FLINK-8827] [scripts] When FLINK_CONF_DIR contains spaces, ZooKeeper related 
scripts fail

This closes #5614


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/6b7e9896
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/6b7e9896
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/6b7e9896

Branch: refs/heads/master
Commit: 6b7e9896eb6a4e2fc628403c9159b7652db2e311
Parents: fb72a80
Author: davidxdh <xu.dong...@zte.com.cn>
Authored: Fri Mar 2 10:55:23 2018 +0800
Committer: Stephan Ewen <se...@apache.org>
Committed: Wed Mar 7 17:37:52 2018 +0100

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh | 6 +++---
 flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh  | 6 +++---
 flink-dist/src/main/flink-bin/bin/zookeeper.sh              | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/6b7e9896/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh 
b/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh
index cc8917b..d5a7593 100755
--- a/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh
+++ b/flink-dist/src/main/flink-bin/bin/start-zookeeper-quorum.sh
@@ -24,8 +24,8 @@ bin=`cd "$bin"; pwd`
 
 # Starts a ZooKeeper quorum as configured in $FLINK_CONF/zoo.cfg
 
-ZK_CONF=$FLINK_CONF_DIR/zoo.cfg
-if [ ! -f $ZK_CONF ]; then
+ZK_CONF="$FLINK_CONF_DIR/zoo.cfg"
+if [ ! -f "$ZK_CONF" ]; then
     echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'."
     exit 1
 fi
@@ -43,4 +43,4 @@ while read server ; do
     else
         echo "[WARN] Parse error. Skipping config entry '$server'."
     fi
-done < <(grep "^server\." $ZK_CONF)
+done < <(grep "^server\." "$ZK_CONF")

http://git-wip-us.apache.org/repos/asf/flink/blob/6b7e9896/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh 
b/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh
index 29ddae4..ad79de8 100755
--- a/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh
+++ b/flink-dist/src/main/flink-bin/bin/stop-zookeeper-quorum.sh
@@ -24,8 +24,8 @@ bin=`cd "$bin"; pwd`
 
 # Stops a ZooKeeper quorum as configured in $FLINK_CONF/zoo.cfg
 
-ZK_CONF=$FLINK_CONF_DIR/zoo.cfg
-if [ ! -f $ZK_CONF ]; then
+ZK_CONF="$FLINK_CONF_DIR/zoo.cfg"
+if [ ! -f "$ZK_CONF" ]; then
     echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'."
     exit 1
 fi
@@ -43,4 +43,4 @@ while read server ; do
     else
         echo "[WARN] Parse error. Skipping config entry '$server'."
     fi
-done < <(grep "^server\." $ZK_CONF)
+done < <(grep "^server\." "$ZK_CONF")

http://git-wip-us.apache.org/repos/asf/flink/blob/6b7e9896/flink-dist/src/main/flink-bin/bin/zookeeper.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/zookeeper.sh 
b/flink-dist/src/main/flink-bin/bin/zookeeper.sh
index ca72bb7..53d7098 100755
--- a/flink-dist/src/main/flink-bin/bin/zookeeper.sh
+++ b/flink-dist/src/main/flink-bin/bin/zookeeper.sh
@@ -33,8 +33,8 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/config.sh
 
-ZK_CONF=$FLINK_CONF_DIR/zoo.cfg
-if [ ! -f $ZK_CONF ]; then
+ZK_CONF="$FLINK_CONF_DIR/zoo.cfg"
+if [ ! -f "$ZK_CONF" ]; then
     echo "[ERROR] No ZooKeeper configuration file found in '$ZK_CONF'."
     exit 1
 fi

Reply via email to