def ensure_ok(self):
    changed = False
    if self._name_is_arn():
        self.topic_arn = self.name
    else:
        self.topic_arn = self._topic_arn_lookup()
    if (not self.topic_arn):
        changed = self._create_topic()
    if (self.topic_arn in self._list_topics()):
        changed |= self._set_topic_attrs()
    elif (self.display_name or self.policy or self.delivery_policy):
        self.module.fail_json(msg='Cannot set display name, policy or delivery policy for SNS topics not owned by this account')
    changed |= self._set_topic_subs()
    return changed
def ensure_ok(self):
    changed = False
    if self._name_is_arn():
        self.topic_arn = self.name
    else:
        self.topic_arn = self._topic_arn_lookup()
    if (not self.topic_arn):
        changed = self._create_topic()
    if (self.topic_arn in self._list_topics()):
        changed |= self._set_topic_attrs()
    elif (self.display_name or self.policy or self.delivery_policy):
        self.module.fail_json(msg='Cannot set display name, policy or delivery policy for SNS topics not owned by this account')
    changed |= self._set_topic_subs()
    return changed