Various cleanup to run_command

* Rename fail_on_rc_non_zero to check_rc, much more succinct.
* Simplify method defintion
* Fix command module and drop shell=shell option; whether to use
  shell is determined by if args is a list.
This commit is contained in:
Stephen Fromm
2013-01-13 09:12:40 -08:00
parent 4f110e4fc6
commit 4eaee3df0a
7 changed files with 18 additions and 24 deletions

View File

@@ -44,7 +44,7 @@ def main():
)
cmd = ["/usr/bin/env", "facter", "--json"]
rc, out, err = module.run_command(cmd, fail_on_rc_non_zero=True)
rc, out, err = module.run_command(cmd, check_rc=True)
module.exit_json(**json.loads(out))
# this is magic, see lib/ansible/module_common.py