[pve-devel] [PATCH ha-manager v2 2/2] API/Status: mark service status if no_start flag set

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 3 13:51:05 CET 2016


Mark those services with the no flag set so that it is clear why they
are not started (even if enabled).

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/API2/HA/Status.pm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/HA/Status.pm b/src/PVE/API2/HA/Status.pm
index 4d94985..4d3278c 100644
--- a/src/PVE/API2/HA/Status.pm
+++ b/src/PVE/API2/HA/Status.pm
@@ -148,8 +148,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,
-			  node => $d->{node}, status => "$sid ($d->{node}, $d->{state})" };
+
+	    my $service_info = {
+		id => "service:$sid",
+		type => 'service',
+		sid => $sid,
+		node => $d->{node},
+		status => "$sid ($d->{node}, $d->{state})",
+	    };
+
+	    $service_info->{status} .= " - (no start)"
+	      if $service_config->{$sid}->{no_start};
+
+	    push @$res, $service_info;
 	}
 
 	# show also service which aren't yet processed by the CRM
-- 
2.1.4





More information about the pve-devel mailing list