ignore empty lines in rabbitmqctl output (#43722)

* ignore empty lines in rabbitmqctl output

this fixes a bug with rabbitmq 3.7.5
rabbitmqctl can return empty lines, breaking the rabbitmq_parameter module
especially in a new vhost, the command rabbitmqctl list_parameters -q -p <vhost> will return an empty line

* Strip empty line in rabbitmqctl output
pull/49468/head
fdeschamps 6 years ago committed by John R Barker
parent af6427bf40
commit faed1bbd96

@ -78,7 +78,7 @@ class RabbitMqParameter(object):
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._rabbitmqctl, '-q', '-n', self.node]
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return out.strip().splitlines()
return list()
def get(self):

Loading…
Cancel
Save