mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
b1a6f1f47b
commit
6dcb41b40f
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue