From 95c1b07bdb8759019ddddf5f769e6220c733ab22 Mon Sep 17 00:00:00 2001 From: bentaylornz Date: Wed, 5 Apr 2017 00:41:20 +1200 Subject: [PATCH] [cloud] re-raise boto ClientError if throttling timeout is reached in efs.py (#23109) * re-raise exception as expected The current ThrottlingException handling code hides other actual exceptions from the user, and basically goes infinite loop instead. eg when the api caller doesn't have permission (example below) to use the api, ansible effectively hangs. adding the re-raise stops execution and shows the error to the command line as expected can test by removing permission to the efs api, and calling the efs: module The error was: botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the DescribeFileSystems operation: User: is not authorized to perform: elasticfilesystem:DescribeFileSystems on the specified resource * PEP8 fix --- lib/ansible/modules/cloud/amazon/efs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/efs.py b/lib/ansible/modules/cloud/amazon/efs.py index 6c4b1927fb..c04d48227b 100644 --- a/lib/ansible/modules/cloud/amazon/efs.py +++ b/lib/ansible/modules/cloud/amazon/efs.py @@ -516,6 +516,9 @@ def iterate_all(attr, map_method, **kwargs): sleep(wait) wait = wait * 2 continue + else: + raise + def targets_equal(keys, a, b): """