Browse code

Merge "Quote error messages"

Zuul authored on 2018/10/10 22:01:04
Showing 1 changed files
... ...
@@ -228,9 +228,9 @@ function err {
228 228
     xtrace=$(set +o | grep xtrace)
229 229
     set +o xtrace
230 230
     local msg="[ERROR] ${BASH_SOURCE[2]}:$1 $2"
231
-    echo $msg 1>&2;
231
+    echo "$msg" 1>&2;
232 232
     if [[ -n ${LOGDIR} ]]; then
233
-        echo $msg >> "${LOGDIR}/error.log"
233
+        echo "$msg" >> "${LOGDIR}/error.log"
234 234
     fi
235 235
     $xtrace
236 236
     return $exitcode
... ...
@@ -283,7 +283,7 @@ function warn {
283 283
     xtrace=$(set +o | grep xtrace)
284 284
     set +o xtrace
285 285
     local msg="[WARNING] ${BASH_SOURCE[2]}:$1 $2"
286
-    echo $msg
286
+    echo "$msg"
287 287
     $xtrace
288 288
     return $exitcode
289 289
 }
... ...
@@ -1444,11 +1444,11 @@ function _common_systemd_pitfalls {
1444 1444
         read -r -d '' msg << EOF || true  # read returns 1 for EOF, but it is ok here
1445 1445
 You are trying to use run_process with sudo, this is not going to work under systemd.
1446 1446
 
1447
-If you need to run a service as a user other than $STACK_USER call it with:
1447
+If you need to run a service as a user other than \$STACK_USER call it with:
1448 1448
 
1449 1449
    run_process \$name \$cmd \$group \$user
1450 1450
 EOF
1451
-        die $LINENO $msg
1451
+        die $LINENO "$msg"
1452 1452
     fi
1453 1453
 
1454 1454
     if [[ ! "$cmd" =~ ^/ ]]; then
... ...
@@ -1458,7 +1458,7 @@ start under systemd.
1458 1458
 
1459 1459
 Please update your run_process stanza to have an absolute path.
1460 1460
 EOF
1461
-        die $LINENO $msg
1461
+        die $LINENO "$msg"
1462 1462
     fi
1463 1463
 
1464 1464
 }