Skip to content

Commit a1ffc4f

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Quote error messages"
2 parents dd0f884 + e8a6a02 commit a1ffc4f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

functions-common

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ function err {
228228
xtrace=$(set +o | grep xtrace)
229229
set +o xtrace
230230
local msg="[ERROR] ${BASH_SOURCE[2]}:$1 $2"
231-
echo $msg 1>&2;
231+
echo "$msg" 1>&2;
232232
if [[ -n ${LOGDIR} ]]; then
233-
echo $msg >> "${LOGDIR}/error.log"
233+
echo "$msg" >> "${LOGDIR}/error.log"
234234
fi
235235
$xtrace
236236
return $exitcode
@@ -283,7 +283,7 @@ function warn {
283283
xtrace=$(set +o | grep xtrace)
284284
set +o xtrace
285285
local msg="[WARNING] ${BASH_SOURCE[2]}:$1 $2"
286-
echo $msg
286+
echo "$msg"
287287
$xtrace
288288
return $exitcode
289289
}
@@ -1444,11 +1444,11 @@ function _common_systemd_pitfalls {
14441444
read -r -d '' msg << EOF || true # read returns 1 for EOF, but it is ok here
14451445
You are trying to use run_process with sudo, this is not going to work under systemd.
14461446
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:
14481448
14491449
run_process \$name \$cmd \$group \$user
14501450
EOF
1451-
die $LINENO $msg
1451+
die $LINENO "$msg"
14521452
fi
14531453

14541454
if [[ ! "$cmd" =~ ^/ ]]; then
@@ -1458,7 +1458,7 @@ start under systemd.
14581458
14591459
Please update your run_process stanza to have an absolute path.
14601460
EOF
1461-
die $LINENO $msg
1461+
die $LINENO "$msg"
14621462
fi
14631463

14641464
}

0 commit comments

Comments
 (0)