mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user