Updating how to run commands in check mode, standarizing quotes

reviewable/pr18780/r1
Chris Hoffman 12 years ago
parent 7ba63ce7ff
commit 74aa9dfe44

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

Loading…
Cancel
Save