diff --git a/lib/ansible/modules/messaging/rabbitmq_policy.py b/lib/ansible/modules/messaging/rabbitmq_policy.py index 0d8c56e326..2480725b1b 100644 --- a/lib/ansible/modules/messaging/rabbitmq_policy.py +++ b/lib/ansible/modules/messaging/rabbitmq_policy.py @@ -113,6 +113,8 @@ class RabbitMqPolicy(object): policies = self._exec(['list_policies'], True) for policy in policies: + if not policy: + continue policy_name = policy.split('\t')[1] if policy_name == self._name: return True