ddanielr commented on code in PR #5158:
URL: https://github.com/apache/accumulo/pull/5158#discussion_r1878636560


##########
assemble/bin/accumulo-cluster:
##########
@@ -177,16 +166,20 @@ function control_service() {
       # using the value of $host
       #
       if [[ $# -gt 3 ]]; then
-        debugAndRun ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" 
"${bin}/accumulo-service" "$service" "$control_cmd" "-a" "$host" "${@:4}"
+        debug "ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\" 
\"${*:4}\"" ||
+          ACCUMULO_SERVICE_INSTANCE="$ACCUMULO_SERVICE_INSTANCE" 
"$bin/accumulo-service" "$service" "$control_cmd" -a "$host" "${@:4}"
       else
-        debugAndRun ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" 
"${bin}/accumulo-service" "$service" "$control_cmd" "-a" "$host"
+        debug "ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\"" ||
+          ACCUMULO_SERVICE_INSTANCE="$ACCUMULO_SERVICE_INSTANCE" 
"$bin/accumulo-service" "$service" "$control_cmd" -a "$host"
       fi
     else
       if [[ $# -gt 3 ]]; then
         EXTRA_ARGS="${*:4}"
-        debugAndRun "$SSH" "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service 
\"$service\" \"$control_cmd\" \"-a\" \"$host\" $EXTRA_ARGS '"
+        debug "$SSH \"$host\" \"bash -c 
'ACCUMULO_SERVICE_INSTANCE=\\\"$ACCUMULO_SERVICE_INSTANCE\\\" 
\\\"$bin/accumulo-service\\\" \\\"$service\\\" \\\"$control_cmd\\\" -a 
\\\"$host\\\" $EXTRA_ARGS '\"" ||
+          $SSH "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\" 
$EXTRA_ARGS '"
       else
-        debugAndRun "$SSH" "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service 
\"$service\" \"$control_cmd\" \"-a\" \"$host\"'"
+        debug "$SSH \"$host\" \"bash -c 
'ACCUMULO_SERVICE_INSTANCE=\\\"$ACCUMULO_SERVICE_INSTANCE\\\" 
\\\"$bin/accumulo-service\\\" \\\"$service\\\" \\\"$control_cmd\\\" -a 
\\\"$host\\\"'\"" ||
+          $SSH "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\"'"

Review Comment:
   Same comment as above



##########
assemble/bin/accumulo-cluster:
##########
@@ -177,16 +166,20 @@ function control_service() {
       # using the value of $host
       #
       if [[ $# -gt 3 ]]; then
-        debugAndRun ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" 
"${bin}/accumulo-service" "$service" "$control_cmd" "-a" "$host" "${@:4}"
+        debug "ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\" 
\"${*:4}\"" ||
+          ACCUMULO_SERVICE_INSTANCE="$ACCUMULO_SERVICE_INSTANCE" 
"$bin/accumulo-service" "$service" "$control_cmd" -a "$host" "${@:4}"
       else
-        debugAndRun ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" 
"${bin}/accumulo-service" "$service" "$control_cmd" "-a" "$host"
+        debug "ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\"" ||
+          ACCUMULO_SERVICE_INSTANCE="$ACCUMULO_SERVICE_INSTANCE" 
"$bin/accumulo-service" "$service" "$control_cmd" -a "$host"
       fi
     else
       if [[ $# -gt 3 ]]; then
         EXTRA_ARGS="${*:4}"
-        debugAndRun "$SSH" "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service 
\"$service\" \"$control_cmd\" \"-a\" \"$host\" $EXTRA_ARGS '"
+        debug "$SSH \"$host\" \"bash -c 
'ACCUMULO_SERVICE_INSTANCE=\\\"$ACCUMULO_SERVICE_INSTANCE\\\" 
\\\"$bin/accumulo-service\\\" \\\"$service\\\" \\\"$control_cmd\\\" -a 
\\\"$host\\\" $EXTRA_ARGS '\"" ||
+          $SSH "$host" "bash -c 
'ACCUMULO_SERVICE_INSTANCE=\"$ACCUMULO_SERVICE_INSTANCE\" 
\"$bin/accumulo-service\" \"$service\" \"$control_cmd\" -a \"$host\" 
$EXTRA_ARGS '"

Review Comment:
   Compared to the original code, this is very difficult to read.
   I think we can modify the original code to remove the reliance on the new 
bash functionality while still supporting the readability of the new changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to