Update rabbitmq_user/vhost/parameter to pass the node to rabbitmqctl using -n flag to rabbitmqctl rather than setting the environment variable.

pull/2867/head
Ceri Storey 12 years ago
parent 72b60286e1
commit c01992b564

@ -77,11 +77,10 @@ class RabbitMqParameter(object):
self._value = None
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
self._env = module.get_bin_path('env', True)
def _exec(self, args, run_in_check_mode=False):
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._env, 'RABBITMQ_NODENAME=%s' % self.node, self._rabbitmqctl, '-q']
cmd = [self._rabbitmqctl, '-q', '-n', self.node]
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return list()

@ -113,11 +113,10 @@ class RabbitMqUser(object):
self._tags = None
self._permissions = None
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
self._env = module.get_bin_path('env', True)
def _exec(self, args, run_in_check_mode=False):
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._env, 'RABBITMQ_NODENAME=%s' % self.node, self._rabbitmqctl, '-q']
cmd = [self._rabbitmqctl, '-q', '-n', self.node]
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return list()

@ -64,11 +64,10 @@ class RabbitMqVhost(object):
self._tracing = False
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
self._env = module.get_bin_path('env', True)
def _exec(self, args, run_in_check_mode=False):
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._env, 'RABBITMQ_NODENAME=%s' % self.node, self._rabbitmqctl, '-q']
cmd = [self._rabbitmqctl, '-q', '-n', self.node]
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return list()

Loading…
Cancel
Save