]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
service data: only set failed_nodes key if needed
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 30 Mar 2019 18:52:46 +0000 (19:52 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 30 Mar 2019 18:52:49 +0000 (19:52 +0100)
Currently we always set this, and thus each services gets a
"failed_nodes": null,
entry in the written out JSON ha/manager_status

so only set if neeed, which can reduce mananager_status quite a bit
with a lot of services.

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

index a6c9b8e76bd1884c40120b2d23220e01ffebd34e..0b90de4baf1c5e0b417472c618cb3aae8af4d868 100644 (file)
@@ -218,7 +218,7 @@ my $change_service_state = sub {
 
     $sd->{state} = $new_state;
     $sd->{node} = $old_node;
-    $sd->{failed_nodes} = $old_failed_nodes;
+    $sd->{failed_nodes} = $old_failed_nodes if defined($old_failed_nodes);
 
     my $text_state = '';
     foreach my $k (sort keys %params) {