def _delete_subscriptions(self):
    subscriptions = self._list_topic_subscriptions()
    if (not subscriptions):
        return False
    for sub in subscriptions:
        if (sub['SubscriptionArn'] not in ('PendingConfirmation', 'Deleted')):
            self.subscriptions_deleted.append(sub['SubscriptionArn'])
            if (not self.check_mode):
                try:
                    self.connection.unsubscribe(SubscriptionArn=sub['SubscriptionArn'])
                except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                    self.module.fail_json_aws(e, msg="Couldn't unsubscribe from topic")
    return True
def _delete_subscriptions(self):
    subscriptions = self._list_topic_subscriptions()
    if (not subscriptions):
        return False
    for sub in subscriptions:
        if (sub['SubscriptionArn'] not in ('PendingConfirmation', 'Deleted')):
            self.subscriptions_deleted.append(sub['SubscriptionArn'])
            if (not self.check_mode):
                try:
                    self.connection.unsubscribe(SubscriptionArn=sub['SubscriptionArn'])
                except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                    self.module.fail_json_aws(e, msg="Couldn't unsubscribe from topic")
    return True