Skip to content

Commit

Permalink
Check that the current output from 'list_users' command contains a '\t'.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mike Liu authored and mattclay committed Dec 8, 2016
1 parent d608dee commit fafb89c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ansible/modules/extras/messaging/rabbitmq_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def get(self):
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:
Expand Down

0 comments on commit fafb89c

Please sign in to comment.