[pve-devel] applied: [PATCH ha-manager] followup code cleanup

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 7 12:16:25 CET 2019


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 at proxmox.com>
---
 src/PVE/HA/LRM.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm
index 5ae96ce..417619b 100644
--- a/src/PVE/HA/LRM.pm
+++ b/src/PVE/HA/LRM.pm
@@ -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");
-- 
2.20.1





More information about the pve-devel mailing list