Add namespace to database backup error logs

Namespace is added to error logs generated by database backup
main script for etcd, mariadb and postgresql database backups

Change-Id: I63d00549327c27ec0590c1a9d05966015f480c92
This commit is contained in:
Huang, Sophie (sh879n) 2020-07-16 21:18:46 +00:00 committed by Travis Neely
parent a689846b10
commit 898f6b94ed

View File

@ -76,7 +76,7 @@ set -x
log_backup_error_exit() {
MSG=$1
ERRCODE=$2
log ERROR "${DB_NAME}_backup" "${MSG}"
log ERROR "${DB_NAME}_backup" "${DB_NAMESPACE} namespace: ${MSG}"
rm -f $ERR_LOG_FILE
rm -rf $TMP_DIR
exit $ERRCODE
@ -338,7 +338,7 @@ backup_databases() {
if [[ $? -ne 0 ]]; then
# This error should print first, then print the summary as the last
# thing that the user sees in the output.
log ERROR "${DB_NAME}_backup" "Backup could not be sent to remote RGW."
log ERROR "${DB_NAME}_backup" "Backup ${TARBALL_FILE} could not be sent to remote RGW."
set +x
echo "=================================================================="
echo "Local backup successful, but could not send to remote RGW."