diff options
author | Lachlan Cooper <lachlancooper@gmail.com> | 2018-03-23 04:03:20 +1100 |
---|---|---|
committer | Sam Doran <sdoran@ansible.com> | 2018-03-22 13:03:20 -0400 |
commit | fcbee7e40baa7403299b3de5cf391eb747ee716f (patch) | |
tree | 042623a4207f303f7cb734b1afb4f074d8480a4e /lib/ansible/modules/messaging | |
parent | 6ad784bbbb68a13a936d492fc07a89cedb486219 (diff) | |
download | ansible-fcbee7e40baa7403299b3de5cf391eb747ee716f.tar.gz |
Check that output from list_vhosts can be split (#37630)
As with list_users, list_vhosts can sometimes return a value that
doesn't contain a '\t' character. This appears to be the case if the
server has no vhosts, for example.
The same fix was applied to the rabbitmq_users module here:
https://github.com/ansible/ansible/commit/fafb89cde58eff5994f607b2dacce880b57bd56d
Diffstat (limited to 'lib/ansible/modules/messaging')
-rw-r--r-- | lib/ansible/modules/messaging/rabbitmq_vhost.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ansible/modules/messaging/rabbitmq_vhost.py b/lib/ansible/modules/messaging/rabbitmq_vhost.py index bc85d92ec9..59d8e61a2d 100644 --- a/lib/ansible/modules/messaging/rabbitmq_vhost.py +++ b/lib/ansible/modules/messaging/rabbitmq_vhost.py @@ -76,6 +76,9 @@ class RabbitMqVhost(object): vhosts = self._exec(['list_vhosts', 'name', 'tracing'], True) for vhost in vhosts: + if '\t' not in vhost: + continue + name, tracing = vhost.split('\t') if name == self.name: self._tracing = self.module.boolean(tracing) |