mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-04 01:33:09 +00:00
Check that the current output from 'list_users' command contains a '\t'.
The `rabbitmqctl list_users` command will list the user's last login time which does not include `\t` character. This is causing a ValueError exception when attempting to split a user and its tags from the command output. This fix will check for a `\t` in the current line of the output before splitting.
This commit is contained in:
@@ -136,6 +136,9 @@ class RabbitMqUser(object):
|
||||
users = self._exec(['list_users'], True)
|
||||
|
||||
for user_tag in users:
|
||||
if '\t' not in user_tag:
|
||||
continue
|
||||
|
||||
user, tags = user_tag.split('\t')
|
||||
|
||||
if user == self.username:
|
||||
|
||||
Reference in New Issue
Block a user