]> git.proxmox.com Git - pve-container.git/commitdiff
vm_stop_cleanup: return early to avoid unecessary indentation levels
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Nov 2019 13:35:01 +0000 (14:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Nov 2019 13:35:01 +0000 (14:35 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC.pm

index 68b88a7be12377c8ce40003ad752e819c0df6c43..61f9baed233ac0ab6698b16fdd75d3477a703d32 100644 (file)
@@ -759,13 +759,12 @@ sub destroy_lxc_container {
 
 sub vm_stop_cleanup {
     my ($storage_cfg, $vmid, $conf, $keepActive) = @_;
-    
-    eval {
-       if (!$keepActive) {
 
-            my $vollist = PVE::LXC::Config->get_vm_volumes($conf);
-           PVE::Storage::deactivate_volumes($storage_cfg, $vollist);
-       }
+    return if $keepActive;
+
+    eval {
+       my $vollist = PVE::LXC::Config->get_vm_volumes($conf);
+       PVE::Storage::deactivate_volumes($storage_cfg, $vollist);
     };
     warn $@ if $@; # avoid errors - just warn
 }