From 5a1395a4867d510cb242113b0a4d27a35fe81ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Wed, 11 Jan 2017 12:57:24 +0100 Subject: [PATCH] sns_topic: Do not attempt to unsubscribed deleted subscriptions (#20086) --- lib/ansible/modules/cloud/amazon/sns_topic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/sns_topic.py b/lib/ansible/modules/cloud/amazon/sns_topic.py index e2b31484a1..6d85994f97 100644 --- a/lib/ansible/modules/cloud/amazon/sns_topic.py +++ b/lib/ansible/modules/cloud/amazon/sns_topic.py @@ -276,7 +276,7 @@ class SnsTopicManager(object): sub_key = (sub['Protocol'], sub['Endpoint']) subscriptions_existing_list.append(sub_key) if self.purge_subscriptions and sub_key not in desired_subscriptions and \ - sub['SubscriptionArn'] != 'PendingConfirmation': + sub['SubscriptionArn'] not in ('PendingConfirmation', 'Deleted'): self.changed = True self.subscriptions_deleted.append(sub_key) if not self.check_mode: @@ -294,7 +294,7 @@ class SnsTopicManager(object): # NOTE: subscriptions in 'PendingConfirmation' timeout in 3 days # https://forums.aws.amazon.com/thread.jspa?threadID=85993 for sub in self.subscriptions_existing: - if sub['SubscriptionArn'] != 'PendingConfirmation': + if sub['SubscriptionArn'] not in ('PendingConfirmation', 'Deleted'): self.subscriptions_deleted.append(sub['SubscriptionArn']) self.changed = True if not self.check_mode: