[pve-devel] [PATCH ha-manager v2 2/2] do not show a service as queued if not configured

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jan 24 18:37:23 CET 2017


The check if a service is configured has precedence over the check if
a service is already processed by the manager.
This fixes a bug where a service could be shown as queued even if he
was meant to be ignored.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/HA/Tools.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PVE/HA/Tools.pm b/src/PVE/HA/Tools.pm
index 565c275..0f49bc5 100644
--- a/src/PVE/HA/Tools.pm
+++ b/src/PVE/HA/Tools.pm
@@ -186,13 +186,13 @@ sub count_fenced_services {
 sub get_verbose_service_state {
     my ($service_state, $service_conf) = @_;
 
+    my $req = $service_conf->{state} // 'ignored';
+    return 'ignored' if $req eq 'ignored';
+
     # service not yet processed by manager
     return 'queued' if !defined($service_state);
     my $cur = $service_state->{state};
 
-    return 'ignore' if !defined($service_conf) || !defined($service_conf->{state});
-    my $req = $service_conf->{state};
-
     # give fast feedback to the user
     my $state = $cur;
     if (!defined($cur)) {
-- 
2.1.4





More information about the pve-devel mailing list