From 2078e3598885da8eb6f3e27554b0fcae176a0d1c Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Mon, 9 May 2022 12:34:09 +0200 Subject: [PATCH] vzdump: generate notes: initialize potentially undef values For VMs, $task->{hostname} might be undef and when running on a stand-alone node, there is no cluster name. Reported-by: Marco Gabriel Signed-off-by: Fabian Ebner --- PVE/VZDump.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index 0dbf8928..a3798851 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -97,8 +97,8 @@ my $generate_notes = sub { $verify_notes_template->($notes_template); my $info = { - cluster => PVE::Cluster::get_clinfo()->{cluster}->{name}, - guestname => $task->{hostname}, + cluster => PVE::Cluster::get_clinfo()->{cluster}->{name} // 'standalone node', + guestname => $task->{hostname} // "VM $task->{vmid}", # is always set for CTs node => PVE::INotify::nodename(), vmid => $task->{vmid}, }; -- 2.39.5