From c01992b56496a992c98f4a433b48792e44312e7a Mon Sep 17 00:00:00 2001 From: Ceri Storey Date: Sun, 26 May 2013 14:51:50 +0100 Subject: [PATCH] Update rabbitmq_user/vhost/parameter to pass the node to rabbitmqctl using -n flag to rabbitmqctl rather than setting the environment variable. --- library/messaging/rabbitmq_parameter | 3 +-- library/messaging/rabbitmq_user | 3 +-- library/messaging/rabbitmq_vhost | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/library/messaging/rabbitmq_parameter b/library/messaging/rabbitmq_parameter index c5b2a51065..fe0b2a4f68 100644 --- a/library/messaging/rabbitmq_parameter +++ b/library/messaging/rabbitmq_parameter @@ -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() diff --git a/library/messaging/rabbitmq_user b/library/messaging/rabbitmq_user index 6e84d32545..ad38de8bb5 100644 --- a/library/messaging/rabbitmq_user +++ b/library/messaging/rabbitmq_user @@ -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() diff --git a/library/messaging/rabbitmq_vhost b/library/messaging/rabbitmq_vhost index f37edb8970..6a99bd56c6 100644 --- a/library/messaging/rabbitmq_vhost +++ b/library/messaging/rabbitmq_vhost @@ -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()