mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
rabbitmq_policy: fix IndexError when no policies exist yet (#33556)
If the list of existing policies is empty, an IndexError would be raised since stdout was blank.
This commit is contained in:
committed by
René Moser
parent
b1a6f1f47b
commit
6dcb41b40f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user