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:
fafb89cde5
pull/37785/head
Lachlan Cooper 7 years ago committed by Sam Doran
parent 6ad784bbbb
commit fcbee7e40b

@ -76,6 +76,9 @@ class RabbitMqVhost(object):
vhosts = self._exec(['list_vhosts', 'name', 'tracing'], True) vhosts = self._exec(['list_vhosts', 'name', 'tracing'], True)
for vhost in vhosts: for vhost in vhosts:
if '\t' not in vhost:
continue
name, tracing = vhost.split('\t') name, tracing = vhost.split('\t')
if name == self.name: if name == self.name:
self._tracing = self.module.boolean(tracing) self._tracing = self.module.boolean(tracing)

Loading…
Cancel
Save