diff --git a/rabbitmq_plugin b/rabbitmq_plugin index 6e724c743f5..73f3dc58ee2 100644 --- a/rabbitmq_plugin +++ b/rabbitmq_plugin @@ -54,23 +54,21 @@ examples: class RabbitMqPlugins(object): def __init__(self, module): self.module = module - self._rabbitmq_plugins = module.get_bin_path("rabbitmq-plugins", True) + self._rabbitmq_plugins = module.get_bin_path('rabbitmq-plugins', True) - def _exec(self, args): + def _exec(self, args, run_in_check_mode=False): cmd = [self._rabbitmq_plugins] rc, out, err = self.module.run_command(cmd + args, check_rc=True) return out.splitlines() def get_all(self): - return self._exec(["list", "-E", "-m"]) + return self._exec(['list', '-E', '-m'], True) def enable(self, name): - if not self.module.check_mode: - self._exec(["enable", name]) + self._exec(['enable', name]) def disable(self, name): - if not self.module.check_mode: - self._exec(["disable", name]) + self._exec(['disable', name]) def main(): arg_spec = dict(