[pve-devel] [PATCH ha-manager 1/6] swap native syslog command with HA environment one

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Nov 7 15:27:08 CET 2017


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/HA/CRM.pm                  | 3 +--
 src/test/test-reboot1/log.expect   | 1 +
 src/test/test-shutdown1/log.expect | 1 +
 src/test/test-shutdown2/log.expect | 1 +
 src/test/test-shutdown3/log.expect | 1 +
 src/test/test-shutdown4/log.expect | 1 +
 6 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/PVE/HA/CRM.pm b/src/PVE/HA/CRM.pm
index 3eec1ff..3dac3ac 100644
--- a/src/PVE/HA/CRM.pm
+++ b/src/PVE/HA/CRM.pm
@@ -5,7 +5,6 @@ package PVE::HA::CRM;
 use strict;
 use warnings;
 
-use PVE::SafeSyslog;
 use PVE::Tools;
 use PVE::HA::Tools;
 
@@ -39,7 +38,7 @@ sub new {
 sub shutdown_request {
     my ($self) = @_;
 
-    syslog('info' , "server received shutdown request")
+    $self->{haenv}->log('info' , "server received shutdown request")
 	if !$self->{shutdown_request};
 
     $self->{shutdown_request} = 1;
diff --git a/src/test/test-reboot1/log.expect b/src/test/test-reboot1/log.expect
index 733e715..0199941 100644
--- a/src/test/test-reboot1/log.expect
+++ b/src/test/test-reboot1/log.expect
@@ -27,6 +27,7 @@ info    125    node3/lrm: stopping service vm:103
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126       reboot: execute crm node3 stop
+info    125    node3/crm: server received shutdown request
 info    145    node3/crm: exit (loop end)
 info    145       reboot: execute power node3 off
 info    145       reboot: execute power node3 on
diff --git a/src/test/test-shutdown1/log.expect b/src/test/test-shutdown1/log.expect
index 11a64d9..da7a24b 100644
--- a/src/test/test-shutdown1/log.expect
+++ b/src/test/test-shutdown1/log.expect
@@ -26,6 +26,7 @@ info    125    node3/lrm: stopping service vm:103
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
+info    125    node3/crm: server received shutdown request
 info    145    node3/crm: exit (loop end)
 info    145     shutdown: execute power node3 off
 info    160    node1/crm: node 'node3': state changed from 'online' => 'unknown'
diff --git a/src/test/test-shutdown2/log.expect b/src/test/test-shutdown2/log.expect
index 104e40e..4994aa9 100644
--- a/src/test/test-shutdown2/log.expect
+++ b/src/test/test-shutdown2/log.expect
@@ -26,6 +26,7 @@ info    125    node3/lrm: stopping service vm:103
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
+info    125    node3/crm: server received shutdown request
 info    145    node3/crm: exit (loop end)
 info    145     shutdown: execute power node3 off
 info    160    node1/crm: node 'node3': state changed from 'online' => 'unknown'
diff --git a/src/test/test-shutdown3/log.expect b/src/test/test-shutdown3/log.expect
index 5cc2eb6..c85bcd6 100644
--- a/src/test/test-shutdown3/log.expect
+++ b/src/test/test-shutdown3/log.expect
@@ -26,6 +26,7 @@ info    125    node3/lrm: stopping service ct:103
 info    125    node3/lrm: service status ct:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
+info    125    node3/crm: server received shutdown request
 info    145    node3/crm: exit (loop end)
 info    145     shutdown: execute power node3 off
 info    160    node1/crm: node 'node3': state changed from 'online' => 'unknown'
diff --git a/src/test/test-shutdown4/log.expect b/src/test/test-shutdown4/log.expect
index 352dd1b..6155401 100644
--- a/src/test/test-shutdown4/log.expect
+++ b/src/test/test-shutdown4/log.expect
@@ -26,6 +26,7 @@ info    121    node1/lrm: stopping service vm:100
 info    121    node1/lrm: service status vm:100 stopped
 info    122    node1/lrm: exit (loop end)
 info    122     shutdown: execute crm node1 stop
+info    121    node1/crm: server received shutdown request
 info    140    node1/crm: voluntary release CRM lock
 info    141    node1/crm: exit (loop end)
 info    141     shutdown: execute power node1 off
-- 
2.11.0





More information about the pve-devel mailing list