diff --git a/changelogs/fragments/34863-rabbitmq_user_unpack_fix.yaml b/changelogs/fragments/34863-rabbitmq_user_unpack_fix.yaml new file mode 100644 index 00000000000..b97b0b18adc --- /dev/null +++ b/changelogs/fragments/34863-rabbitmq_user_unpack_fix.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Ignore empty result of rabbitmqctl list_user_permissions. diff --git a/lib/ansible/modules/messaging/rabbitmq_user.py b/lib/ansible/modules/messaging/rabbitmq_user.py index 6d87d7626fd..952a7f6bcc2 100644 --- a/lib/ansible/modules/messaging/rabbitmq_user.py +++ b/lib/ansible/modules/messaging/rabbitmq_user.py @@ -172,7 +172,7 @@ class RabbitMqUser(object): return False def _get_permissions(self): - perms_out = self._exec(['list_user_permissions', self.username], True) + perms_out = [perm for perm in self._exec(['list_user_permissions', self.username], True) if perm.strip()] perms_list = list() for perm in perms_out: