MT#56004 functions: Add a fallback value for NGCPCFG_PID

This variable is assumed to be set and exported by ngcpcfg when it
starts running. But we have code (in the ngcp-upgrade steps), which
calls the restore-permissions helper directly w/o going through ngcpcfg,
and which then breaks when the variable is not yet set.

Add a fallback value so that we do not fail anymore. But we should
eventually expose this functionality as an actual command as part of
the public ngcpcfg CLI.

Change-Id: Ibda18faaff8a26a04240e6ed7a46ee7650b82954
(cherry picked from commit 183e80936d)
mr12.5
Guillem Jover 6 months ago
parent b2b4ffb402
commit 5e87c22b26

@ -24,7 +24,10 @@ console_output() {
## logging functions {{{
log_only() {
logger -t ngcpcfg --id="${NGCPCFG_PID}" -- "$*"
# XXX: The NGCPCFG_PID variable should be set by ngcpcfg, but we currently
# have code that executes helpers directly, where we should have exposed
# those helpers as new commands. For now we fallback to the current PID.
logger -t ngcpcfg --id="${NGCPCFG_PID:-$$}" -- "$*"
}
log_info() {

Loading…
Cancel
Save