Update rabbitmq_user/vhost/parameter to pass the node to rabbitmqctl using -n flag to rabbitmqctl rather than setting the environment variable.
This commit is contained in:
parent
72b60286e1
commit
c01992b564
3 changed files with 3 additions and 6 deletions
|
@ -77,11 +77,10 @@ class RabbitMqParameter(object):
|
||||||
self._value = None
|
self._value = None
|
||||||
|
|
||||||
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
|
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):
|
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):
|
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)
|
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
|
||||||
return out.splitlines()
|
return out.splitlines()
|
||||||
return list()
|
return list()
|
||||||
|
|
|
@ -113,11 +113,10 @@ class RabbitMqUser(object):
|
||||||
self._tags = None
|
self._tags = None
|
||||||
self._permissions = None
|
self._permissions = None
|
||||||
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
|
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):
|
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):
|
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)
|
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
|
||||||
return out.splitlines()
|
return out.splitlines()
|
||||||
return list()
|
return list()
|
||||||
|
|
|
@ -64,11 +64,10 @@ class RabbitMqVhost(object):
|
||||||
|
|
||||||
self._tracing = False
|
self._tracing = False
|
||||||
self._rabbitmqctl = module.get_bin_path('rabbitmqctl', True)
|
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):
|
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):
|
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)
|
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
|
||||||
return out.splitlines()
|
return out.splitlines()
|
||||||
return list()
|
return list()
|
||||||
|
|
Loading…
Reference in a new issue