Updating how to run commands in check mode

This commit is contained in:
Chris Hoffman
2013-02-10 17:20:44 -05:00
parent ca3b8228f7
commit 507e49396b
2 changed files with 24 additions and 26 deletions

View File

@@ -57,9 +57,11 @@ class RabbitMqPlugins(object):
self._rabbitmq_plugins = module.get_bin_path('rabbitmq-plugins', True)
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()
if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):
cmd = [self._rabbitmq_plugins]
rc, out, err = self.module.run_command(cmd + args, check_rc=True)
return out.splitlines()
return list()
def get_all(self):
return self._exec(['list', '-E', '-m'], True)