Merge pull request #2382 from centreon/fix-docker

fix tasks docker
This commit is contained in:
qgarnier 2020-11-27 12:01:58 +01:00 committed by GitHub
commit 76effa7f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -360,8 +360,11 @@ sub api_list_services {
my ($self, %options) = @_;
my $services = {};
foreach my $node_name (@{$self->{node_names}}) {
foreach my $node_name (@{$self->{node_names}}) {
# 406 or 503 - node is not part of a swarm
my $list_tasks = $self->internal_api_list_tasks(node_name => $node_name);
next if ($self->{http}->get_code() == 406 || $self->{http}->get_code() == 503);
my $list_services = $self->internal_api_list_services(node_name => $node_name);
foreach my $task (@$list_tasks) {
$services->{ $task->{ServiceID} } = {} if (!defined($services->{ $task->{ServiceID} }));