From ae589af601af196e39e3d56ae9605f3e7542e4c3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 4 May 2020 15:17:45 +0200 Subject: [PATCH] fix loop meraki --- network/cisco/meraki/cloudcontroller/restapi/custom/api.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network/cisco/meraki/cloudcontroller/restapi/custom/api.pm b/network/cisco/meraki/cloudcontroller/restapi/custom/api.pm index ca32a5106..c70f0b2df 100644 --- a/network/cisco/meraki/cloudcontroller/restapi/custom/api.pm +++ b/network/cisco/meraki/cloudcontroller/restapi/custom/api.pm @@ -162,7 +162,7 @@ sub request_api { #403: Forbidden- You don't have permission to do that. #404: Not found- No such URL, or you don't have access to the API or organization at all. #429: Too Many Requests- You submitted more than 5 calls in 1 second to an Organization, triggering rate limiting. This also applies for API calls made across multiple organizations that triggers rate limiting for one of the organizations. - do { + while (1) { my $response = $self->{http}->request( url_path => '/api/v0' . $options{endpoint}, critical_status => '', @@ -186,8 +186,9 @@ sub request_api { $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->option_exit(); } + return ($content); - } while (1); + } } sub cache_meraki_entities {