]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
followup code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Jan 2019 11:07:03 +0000 (12:07 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Jan 2019 11:07:05 +0000 (12:07 +0100)
addresses a few nits from Fabians review at:
https://pve.proxmox.com/pipermail/pve-devel/2018-December/035061.html
https://pve.proxmox.com/pipermail/pve-devel/2018-December/035085.html

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

index 5ae96ce28e5fb3ccd3b9fa3202c510c6f8133d42..417619b5d16852880da783f1fa34330f47c122dd 100644 (file)
@@ -60,7 +60,7 @@ sub shutdown_request {
        $haenv->log('info', "got shutdown request with shutdown policy '$shutdown_policy'");
     }
 
-    my $freeze_all = $reboot;
+    my $freeze_all;
     if ($shutdown_policy eq 'conditional') {
        $freeze_all = $reboot;
     } elsif ($shutdown_policy eq 'freeze') {
@@ -68,7 +68,8 @@ sub shutdown_request {
     } elsif ($shutdown_policy eq 'failover') {
        $freeze_all = 0;
     } else {
-       $haenv->log('err', "unkown shutdown policy '$shutdown_policy', fall back to conditional");
+       $haenv->log('err', "unknown shutdown policy '$shutdown_policy', fall back to conditional");
+       $freeze_all = $reboot;
     }
 
     if ($shutdown) {
@@ -88,7 +89,7 @@ sub shutdown_request {
 
     if ($shutdown) {
        if ($freeze_all) {
-           if ($shutdown_policy eq 'conditional') {
+           if ($reboot) {
                $haenv->log('info', "reboot LRM, stop and freeze all services");
            } else {
                $haenv->log('info', "shutdown LRM, stop and freeze all services");