]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
read_and_check_resources_config: remove dead if branch
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 5 Oct 2019 16:34:31 +0000 (18:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 5 Oct 2019 16:58:26 +0000 (18:58 +0200)
we only come to the if (!$vmd) check if the previous
if (my $vmd = $vmlist->{ids}->{$name) is taken, which means $vmd is
always true then.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/Config.pm

index 676eaafdd978aa43ec7c66da4d052b8b0e3d602b..2deef10956c6dfa177a8249ae5cc952908f14732 100644 (file)
@@ -106,12 +106,8 @@ sub read_and_check_resources_config {
        $d->{max_relocate} = 1 if !defined($d->{max_relocate});
        if (PVE::HA::Resources->lookup($d->{type})) {
            if (my $vmd = $vmlist->{ids}->{$name}) {
-               if (!$vmd) {
-                   warn "no such VM '$name'\n";
-               } else {
-                   $d->{node} = $vmd->{node};
-                   $conf->{$sid} = $d;
-               }
+               $d->{node} = $vmd->{node};
+               $conf->{$sid} = $d;
            } else {
                if (defined($d->{node})) {
                    $conf->{$sid} = $d;