Updating how to run commands in check mode, standarizing quotes

This commit is contained in:
Chris Hoffman 2013-02-10 17:14:24 -05:00
parent 7ba63ce7ff
commit 74aa9dfe44

View file

@ -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(