diff options
author | Mark Chappell <mchappel@redhat.com> | 2020-02-05 18:16:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 12:16:07 -0500 |
commit | 50eb2f69574e63f50975cd4d28ca16b941ceb1b8 (patch) | |
tree | dd924887b138dd7348e40a928a34db3d921f1a52 | |
parent | 2f77a6f1f077ad3f8c48c89bb21e705c22da45fb (diff) | |
download | ansible-50eb2f69574e63f50975cd4d28ca16b941ceb1b8.tar.gz |
sns_topic: Retry on Topic 'NotFound' Exceptions when attempting to list subscriptions (#67089)
* sns_topic: Retry on Topic 'NotFound' Exceptions when attempting to list subscriptions
* add changelog
-rw-r--r-- | changelogs/fragments/67089-sns_topic-notfound-backoff.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/modules/cloud/amazon/sns_topic.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/changelogs/fragments/67089-sns_topic-notfound-backoff.yaml b/changelogs/fragments/67089-sns_topic-notfound-backoff.yaml new file mode 100644 index 0000000000..dcd01aad48 --- /dev/null +++ b/changelogs/fragments/67089-sns_topic-notfound-backoff.yaml @@ -0,0 +1,2 @@ +minor_changes: +- sns_topic - Add backoff when we get Topic ``NotFound`` exceptions while listing the subscriptions. diff --git a/lib/ansible/modules/cloud/amazon/sns_topic.py b/lib/ansible/modules/cloud/amazon/sns_topic.py index 48248a9d44..d0059d1359 100644 --- a/lib/ansible/modules/cloud/amazon/sns_topic.py +++ b/lib/ansible/modules/cloud/amazon/sns_topic.py @@ -264,12 +264,12 @@ class SnsTopicManager(object): paginator = self.connection.get_paginator('list_topics') return paginator.paginate().build_full_result()['Topics'] - @AWSRetry.jittered_backoff() + @AWSRetry.jittered_backoff(catch_extra_error_codes=['NotFound']) def _list_topic_subscriptions_with_backoff(self): paginator = self.connection.get_paginator('list_subscriptions_by_topic') return paginator.paginate(TopicArn=self.topic_arn).build_full_result()['Subscriptions'] - @AWSRetry.jittered_backoff() + @AWSRetry.jittered_backoff(catch_extra_error_codes=['NotFound']) def _list_subscriptions_with_backoff(self): paginator = self.connection.get_paginator('list_subscriptions') return paginator.paginate().build_full_result()['Subscriptions'] |