mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-13 21:24:01 +00:00
fix #4351: vzdump: send mail if job-end hook fails with mailnotification=failure
Since all tasks succeeded, previously no mail was sent in that case. Note that the error passed to $self->sendmail() is added to the subject of the mail if it is a single line or the beginning of the mail otherwise. Thus changing the mail slightly compared to previously for the case where the job-start hook fails and the case where the job-end hook fails with mailnotification=always. But can be considered an improvement, because the user sees the error right away. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
2389b2fa05
commit
268c642826
@ -1305,10 +1305,14 @@ sub exec_backup {
|
||||
my $totaltime = time() - $starttime;
|
||||
|
||||
eval {
|
||||
# otherwise $self->sendmail() will interpret it as multiple problems
|
||||
my $chomped_err = $err;
|
||||
chomp($chomped_err) if $chomped_err;
|
||||
|
||||
$self->sendmail(
|
||||
$tasklist,
|
||||
$totaltime,
|
||||
undef,
|
||||
$chomped_err,
|
||||
$self->{job_init_log} . $job_start_log,
|
||||
$job_end_log,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user