Commit ca3b8228 by Chris Hoffman

Updating how to run commands in check mode, standarizing quotes

parent 2c947c2e
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment