mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow yum module to use package or name as an alias for 'pkg'
This commit is contained in:
parent
529a194950
commit
b418632a8d
1 changed files with 3 additions and 3 deletions
|
@ -318,14 +318,14 @@ def main():
|
|||
return 1, str(e)
|
||||
|
||||
elif 'state' in params:
|
||||
if 'pkg' not in params:
|
||||
pkg = params.get('pkg', params.get('package', params.get('name', None)))
|
||||
if 'pkg' is None:
|
||||
results['msg'] = "No pkg specified"
|
||||
else:
|
||||
try:
|
||||
my = yum_base(conf_file=params['conf_file'], cachedir=True)
|
||||
state = params['state']
|
||||
pkgspec = params['pkg']
|
||||
results = ensure(my, state, pkgspec)
|
||||
results = ensure(my, state, pkg)
|
||||
except Exception, e:
|
||||
return 1, str(e)
|
||||
|
||||
|
|
Loading…
Reference in a new issue