Skip to content

Commit

Permalink
Issue #3326. Fix for pipe_mail, changes on returning values from func…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
SilinPavel committed Aug 10, 2023
1 parent 94776ee commit ced3998
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workflows/pipe-common/shell/pipe_mail
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exec 2>&1

function construct_email_subject {
local _grid_engine_msg=$1
echo "Run #$RUN_ID. Job info: $_grid_engine_msg"
export _NOTIFICATION_SUBJECT="Run #$RUN_ID. Job info: $_grid_engine_msg"
}

function get_cp_user_id {
Expand Down Expand Up @@ -42,7 +42,7 @@ function get_cp_user_id {
_effective_user_id="$OWNER_CP_ACCOUNT"
fi

echo "$_effective_user_id"
export _to_user="$_effective_user_id"
}

echo "Start sending emails to pipeline users"
Expand All @@ -63,7 +63,7 @@ case $key in
shift # past argument
;;
-s) # Subject of the email to be sent
export _NOTIFICATION_SUBJECT=$(construct_email_subject "$2")
construct_email_subject "$2"
shift # past argument
shift # past value
;;
Expand All @@ -78,7 +78,7 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
echo "Sending emails to: $@"
while [[ $# -gt 0 ]]
do
_to_user=$(get_cp_user_id "$1")
get_cp_user_id "$1"
pipe_notify "$_NOTIFICATION_SUBJECT" "$_NOTIFICATION_SUBJECT" "$_to_user"
pipe_log_info "Sending notification. Receiver '$_to_user'. Subject '$_NOTIFICATION_SUBJECT'" "Notifications"
shift # skip email that was already processed
Expand Down

0 comments on commit ced3998

Please sign in to comment.