diff --git a/cloud/docker/restapi/custom/api.pm b/cloud/docker/restapi/custom/api.pm index c8e5f55ee..bdcb2b27c 100644 --- a/cloud/docker/restapi/custom/api.pm +++ b/cloud/docker/restapi/custom/api.pm @@ -223,6 +223,8 @@ sub internal_api_list_nodes { $nodes = []; $self->{output}->output_add(severity => 'UNKNOWN', short_msg => "Node '$options{node_name}': cannot decode json list nodes response: $@"); + } else { + $nodes = [] if (ref($item) eq 'HASH'); # nodes is not in a swarm } return $nodes;