public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] vzdump: send mail if job-abort hook fails
Date: Wed, 16 Nov 2022 09:30:14 +0100	[thread overview]
Message-ID: <20221116083014.27457-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20221116083014.27457-1-f.ebner@proxmox.com>

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/VZDump.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 9ef3c7b4..a04837e7 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -1287,9 +1287,9 @@ sub exec_backup {
     };
     my $err = $@;
 
-    $self->run_hook_script ('job-abort', undef, $job_end_fd) if $err;
-
     if ($err) {
+	eval { $self->run_hook_script ('job-abort', undef, $job_end_fd); };
+	$err .= $@ if $@;
 	debugmsg ('err', "Backup job failed - $err", undef, 1);
     } else {
 	if ($errcount) {
-- 
2.30.2





  reply	other threads:[~2022-11-16  8:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  8:30 [pve-devel] [PATCH manager 1/2] fix #4351: vzdump: send mail if job-end hook fails with mailnotification=failure Fiona Ebner
2022-11-16  8:30 ` Fiona Ebner [this message]
2022-11-16 10:31 ` [pve-devel] applied-series: " Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221116083014.27457-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal