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

Yum package state defaults to installed

This commit is contained in:
Michael DeHaan 2012-04-11 20:47:38 -04:00
parent 8152e44efd
commit ff5d329374

View file

@ -317,22 +317,18 @@ def main():
except Exception, e:
return 1, str(e)
elif 'state' in params:
else:
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']
state = params.get('state', 'installed')
results = ensure(my, state, pkg)
except Exception, e:
return 1, str(e)
else:
print json.dumps(dict(failed=True, msg='invalid module parameters'))
sys.exit(1)
print json.dumps(results)
return 0, None