Signed-off-by: Wei Jihui weijihuiall@163.com --- tests/email | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/email b/tests/email index 40b48fd9..a5f87d42 100755 --- a/tests/email +++ b/tests/email @@ -15,7 +15,7 @@ data_failure() data="To: $my_email Subject: [NOTIFY Compass-ci] Test job failed
-Dear $my_name: +Dear $my_username:
Sorry to inform you that your test job is failed. you can click the following link to view details. http://api.compass-ci.openeuler.org:$SRV_HTTP_PORT/$result_root @@ -33,6 +33,7 @@ compose_email() run_email() { [ -n "$my_email" ] || return 0 + my_username=$(echo "$my_email" | awk -F '@' '{print $1}') compose_email curl -XPOST "${MAIL_HOST:-$LKP_SERVER}:${MAIL_PORT:-49000}/send_mail_text" -d "$data" }
run_email() { [ -n "$my_email" ] || return 0
- my_username=$(echo "$my_email" | awk -F '@' '{print $1}')
This may be easier in sh: my_username=${my_email%@*}
Thanks, RenWen
compose_email curl -XPOST "${MAIL_HOST:-$LKP_SERVER}:${MAIL_PORT:-49000}/send_mail_text" -d "$data" } -- 2.23.0
The changelog is empty and it's hard to infer the situation.
-Dear $my_name: +Dear $my_username:
$my_name can be empty? Then it looks like a problem.
Even if $my_name can be empty, then we should check use it in the first place when it's not empty?
Thanks, Fengguang
Sorry to inform you that your test job is failed. you can click the following link to view details. http://api.compass-ci.openeuler.org:$SRV_HTTP_PORT/$result_root @@ -33,6 +33,7 @@ compose_email() run_email() { [ -n "$my_email" ] || return 0
- my_username=$(echo "$my_email" | awk -F '@' '{print $1}') compose_email curl -XPOST "${MAIL_HOST:-$LKP_SERVER}:${MAIL_PORT:-49000}/send_mail_text" -d "$data"
}
2.23.0