]> git.proxmox.com Git - pve-ha-manager.git/blobdiff - src/PVE/HA/CRM.pm
Fix Typo
[pve-ha-manager.git] / src / PVE / HA / CRM.pm
index 4961b0ebb305ddf0a43bff598b148fc21a865e99..4196bba3c15d07cf0c4e68c9a954f19ff914b72f 100644 (file)
@@ -16,7 +16,7 @@ use PVE::HA::Manager;
 my $valid_states = {
     wait_for_quorum => "cluster is not quorate, waiting",
     master => "quorate, and we got the ha_manager lock",
-    lost_manager_lock => "we lost the ha_manager lock (watchgog active)",
+    lost_manager_lock => "we lost the ha_manager lock (watchdog active)",
     slave => "quorate, but we do not own the ha_manager lock",
 };
 
@@ -71,7 +71,6 @@ sub set_local_status {
 
     # fixme: do not use extra class
     if ($new->{state} eq 'master') {
-       mkdir("/etc/pve/ha");
        $self->{manager} = PVE::HA::Manager->new($haenv);
     } else {
        if ($self->{manager}) {
@@ -138,7 +137,8 @@ sub do_one_iteration {
 
     if ($state eq 'wait_for_quorum') {
 
-       if (!$pending_fencing && $haenv->quorate()) {
+       if (!$pending_fencing && $haenv->quorate() &&
+           $haenv->service_config_exists()) {
            if ($self->get_protected_ha_manager_lock()) {
                $self->set_local_status({ state => 'master' });
            } else {
@@ -148,7 +148,8 @@ sub do_one_iteration {
 
     } elsif ($state eq 'slave') {
 
-       if (!$pending_fencing && $haenv->quorate()) {
+       if (!$pending_fencing && $haenv->quorate() &&
+           $haenv->service_config_exists()) {
            if ($self->get_protected_ha_manager_lock()) {
                $self->set_local_status({ state => 'master' });
            }