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:
Mike Liu 2015-09-05 12:37:32 -04:00
parent 6a3cf63351
commit ae7f7c2c64

View file

@ -136,6 +136,9 @@ class RabbitMqUser(object):
users = self._exec(['list_users'], True) users = self._exec(['list_users'], True)
for user_tag in users: for user_tag in users:
if '\t' not in user_tag:
continue
user, tags = user_tag.split('\t') user, tags = user_tag.split('\t')
if user == self.username: if user == self.username: