This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new a2f3927c45 HDDS-9368. Fix syntax error in run.sh for bash older than 
4.2 (#5379)
a2f3927c45 is described below

commit a2f3927c45028f4cb13bf828dd78c8f2ab18585d
Author: hmohamedansari <[email protected]>
AuthorDate: Thu Dec 21 14:09:49 2023 +0530

    HDDS-9368. Fix syntax error in run.sh for bash older than 4.2 (#5379)
---
 hadoop-ozone/dist/src/main/compose/ozone/run.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/compose/ozone/run.sh 
b/hadoop-ozone/dist/src/main/compose/ozone/run.sh
index 5bdb2996cb..671d2cda6c 100755
--- a/hadoop-ozone/dist/src/main/compose/ozone/run.sh
+++ b/hadoop-ozone/dist/src/main/compose/ozone/run.sh
@@ -21,7 +21,7 @@ ORIG_DATANODES="${OZONE_DATANODES:-}"
 ORIG_REPLICATION_FACTOR="${OZONE_REPLICATION_FACTOR:-}"
 
 # only support replication factor of 1 or 3
-if [[ -v OZONE_REPLICATION_FACTOR ]] && [[ ${OZONE_REPLICATION_FACTOR} -ne 1 
]] && [[ ${OZONE_REPLICATION_FACTOR} -ne 3 ]]; then
+if [[ -n ${OZONE_REPLICATION_FACTOR} ]] && [[ ${OZONE_REPLICATION_FACTOR} -ne 
1 ]] && [[ ${OZONE_REPLICATION_FACTOR} -ne 3 ]]; then
   # assume invalid replication factor was intended as "number of datanodes"
   if [[ -z ${ORIG_DATANODES} ]]; then
     OZONE_DATANODES=${OZONE_REPLICATION_FACTOR}
@@ -30,22 +30,22 @@ if [[ -v OZONE_REPLICATION_FACTOR ]] && [[ 
${OZONE_REPLICATION_FACTOR} -ne 1 ]]
 fi
 
 # at least 1 datanode
-if [[ -v OZONE_DATANODES ]] && [[ ${OZONE_DATANODES} -lt 1 ]]; then
+if [[ -n ${OZONE_DATANODES} ]] && [[ ${OZONE_DATANODES} -lt 1 ]]; then
   unset OZONE_DATANODES
 fi
 
-if [[ -v OZONE_DATANODES ]] && [[ -v OZONE_REPLICATION_FACTOR ]]; then
+if [[ -n ${OZONE_DATANODES} ]] && [[ -n ${OZONE_REPLICATION_FACTOR} ]]; then
   # ensure enough datanodes for replication factor
   if [[ ${OZONE_DATANODES} -lt ${OZONE_REPLICATION_FACTOR} ]]; then
     OZONE_DATANODES=${OZONE_REPLICATION_FACTOR}
   fi
-elif [[ -v OZONE_DATANODES ]]; then
+elif [[ -n ${OZONE_DATANODES} ]]; then
   if [[ ${OZONE_DATANODES} -ge 3 ]]; then
     OZONE_REPLICATION_FACTOR=3
   else
     OZONE_REPLICATION_FACTOR=1
   fi
-elif [[ -v OZONE_REPLICATION_FACTOR ]]; then
+elif [[ -n ${OZONE_REPLICATION_FACTOR} ]]; then
   OZONE_DATANODES=${OZONE_REPLICATION_FACTOR}
 else
   OZONE_DATANODES=1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to