1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

rename variable 'pkg' in yum module such that the auto-handled error messages use the same key.

This commit is contained in:
Michael DeHaan 2012-08-11 18:16:10 -04:00
parent 81fa48c86e
commit 67301c1015

View file

@ -403,9 +403,9 @@ def ensure(module, state, pkgspec, conf_file):
return dict(changed=False, failed=True, results='', errors='unexpected state')
def main():
# state=installed pkg=pkgspec
# state=removed pkg=pkgspec
# state=latest pkg=pkgspec
# state=installed name=pkgspec
# state=removed name=pkgspec
# state=latest name=pkgspec
#
# informational commands:
# list=installed
@ -416,14 +416,14 @@ def main():
module = AnsibleModule(
argument_spec = dict(
pkg=dict(aliases=['name']),
name=dict(aliases=['name']),
# removed==absent, installed==present, these are accepted as aliases
state=dict(default='installed', choices=['absent','present','installed','removed','latest']),
list=dict(),
conf_file=dict(default=None),
),
required_one_of = [['pkg','list']],
mutually_exclusive = [['pkg','list']]
required_one_of = [['name','list']],
mutually_exclusive = [['name','list']]
)
params = module.params
@ -435,7 +435,7 @@ def main():
module.exit_json(**results)
else:
pkg = params['pkg']
pkg = params['name']
state = params['state']
res = ensure(module, state, pkg, params['conf_file'])
module.fail_json(msg="we should never get here unless this all failed", **res)