]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
status: show added but not yet active services
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Mar 2016 11:40:51 +0000 (12:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 15 Mar 2016 11:48:23 +0000 (12:48 +0100)
If the CRM is dead or not active yet and we add a new service, we do
not see it in the HA status. This can be confusing for the user as
it is queued for adding but does not shows up, so lets show those
services also.

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

index 252cd7884b4570f82cd086ed9c09103fdc8913ac..682c2ab633542749c670083b958de593179b28ea 100644 (file)
@@ -151,10 +151,19 @@ __PACKAGE__->register_method ({
 
        foreach my $sid (sort keys %{$status->{service_status}}) {
            my $d = $status->{service_status}->{$sid};
-           push @$res, { id => "service:$sid", type => 'service', sid => $sid, 
+           push @$res, { id => "service:$sid", type => 'service', sid => $sid,
                          node => $d->{node}, status => "$sid ($d->{node}, $d->{state})" };
        }
-               
+
+       # show also service which aren't yet processed by the CRM
+       foreach my $sid (sort keys %$service_config) {
+           next if $status->{service_status}->{$sid};
+           my $d = $service_config->{$sid};
+           push @$res, { id => "service:$sid", type => 'service', sid => $sid,
+                         status => "$sid ($d->{node}, queued)",
+                         node => $d->{node} };
+       }
+
        return $res;
     }});