From d069275fc969665aabe0e0c0f48d96993e050fb1 Mon Sep 17 00:00:00 2001 From: Oguz Bektas Date: Mon, 3 Feb 2020 16:23:55 +0100 Subject: [PATCH] fix #2578: check if $target is provided in clone MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit regression introduced with commit a85ff91b previously we set $target to undef if it's localnode or localhost, then we check if node exists. with regression commit, behaviour changes as we do the node check in else, but $target may be undef. this causes an error: no such cluster node '' Signed-off-by: Oguz Bektas improved readability Signed-off-by: Fabian Grünbichler --- PVE/API2/Qemu.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index e15c0c36..5cbcc54e 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2749,12 +2749,12 @@ __PACKAGE__->register_method({ my $localnode = PVE::INotify::nodename(); - if ($target && ($target eq $localnode || $target eq 'localhost')) { + if ($target eq $localnode || $target eq 'localhost') { undef $target; - } else { - PVE::Cluster::check_node_exists($target); } + PVE::Cluster::check_node_exists($target) if $target; + my $storecfg = PVE::Storage::config(); if ($storage) { -- 2.39.5