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


##########
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:
   I can certainly convert the boolean operator to if-else statements, which 
may help a bit. But the underlying issue is that what is printed as DEBUG will 
not be possible to be copy-and-pasted directly, because merely echoing the 
command will not have the proper quoting.



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