public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] vzdump: fix notifications for backing up VMs with 2+ disks to PBS
@ 2023-08-25  9:45 Lukas Wagner
  2023-08-25 13:32 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2023-08-25  9:45 UTC (permalink / raw)
  To: pve-devel

In some situations, such as backing up VMs with 2 or more disks to
PBS, we get passed the backup archive size as a string instead of
as an integer. This led to errors rendering the notification template
down the line.

This commit explicitly casts the data from the task table to an int.
It would be a good idea to actually hunt down the places that produced
the string instead of an integer, but as a quick fix and as a
safeguard against similar lurking errors this approach is fine, IMO.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
Popped up in:
https://forum.proxmox.com/threads/keine-mails-mehr-nach-backup.132675/

 PVE/VZDump.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 2671e3b1..454ab494 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -387,11 +387,11 @@ sub build_guest_table {
 	my $size = $successful ? $task->{size} : 0;
 	my $filename = $successful ? $task->{target} : undef;
 	push @{$table->{data}}, {
-	    "vmid" => $task->{vmid},
+	    "vmid" => int($task->{vmid}),
 	    "name" => $task->{hostname},
 	    "status" => $task->{state},
-	    "time" => $task->{backuptime},
-	    "size" => $size,
+	    "time" => int($task->{backuptime}),
+	    "size" => int($size),
 	    "filename" => $filename,
 	};
     }
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] vzdump: fix notifications for backing up VMs with 2+ disks to PBS
  2023-08-25  9:45 [pve-devel] [PATCH manager] vzdump: fix notifications for backing up VMs with 2+ disks to PBS Lukas Wagner
@ 2023-08-25 13:32 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-08-25 13:32 UTC (permalink / raw)
  To: Proxmox VE development discussion, Lukas Wagner

Am 25/08/2023 um 11:45 schrieb Lukas Wagner:
> In some situations, such as backing up VMs with 2 or more disks to
> PBS, we get passed the backup archive size as a string instead of
> as an integer. This led to errors rendering the notification template
> down the line.
> 
> This commit explicitly casts the data from the task table to an int.
> It would be a good idea to actually hunt down the places that produced
> the string instead of an integer, but as a quick fix and as a
> safeguard against similar lurking errors this approach is fine, IMO.
> 
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
> Popped up in:
> https://forum.proxmox.com/threads/keine-mails-mehr-nach-backup.132675/
> 
>  PVE/VZDump.pm | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-25 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  9:45 [pve-devel] [PATCH manager] vzdump: fix notifications for backing up VMs with 2+ disks to PBS Lukas Wagner
2023-08-25 13:32 ` [pve-devel] applied: " Thomas Lamprecht

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