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:
Michael Tharp 2018-01-26 16:00:53 -05:00 committed by René Moser
parent b1a6f1f47b
commit 6dcb41b40f

View file

@ -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