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

failed should not be in the result returns for a module upon success

This commit is contained in:
Michael DeHaan 2012-08-01 22:30:22 -04:00
parent fe87a16a3e
commit b7c3fd1246

View file

@ -149,7 +149,6 @@ def install(module, items, repoq, yum_basecmd):
res['results'] = '' res['results'] = ''
res['msg'] = '' res['msg'] = ''
res['rc'] = 0 res['rc'] = 0
res['failed'] = False
res['changed'] = False res['changed'] = False
for spec in items: for spec in items:
@ -203,13 +202,11 @@ def install(module, items, repoq, yum_basecmd):
# look for the pkg via obsoletes # look for the pkg via obsoletes
if rc: if rc:
res['changed'] = False res['changed'] = False
res['failed'] = True
res['rc'] = rc res['rc'] = rc
res['results'] += out res['results'] += out
res['msg'] += err res['msg'] += err
else: else:
res['changed'] = True res['changed'] = True
res['failed'] = False
res['rc'] = 0 res['rc'] = 0
res['results'] += out res['results'] += out
res['msg'] += err res['msg'] += err
@ -222,7 +219,6 @@ def remove(module, items, repoq, yum_basecmd):
res['results'] = '' res['results'] = ''
res['msg'] = '' res['msg'] = ''
res['changed'] = False res['changed'] = False
res['failed'] = False
res['rc'] = 0 res['rc'] = 0
for spec in items: for spec in items:
@ -261,7 +257,6 @@ def remove(module, items, repoq, yum_basecmd):
res['msg'] += err res['msg'] += err
else: else:
res['changed'] = True res['changed'] = True
res['failed'] = False
res['rc'] = 0 res['rc'] = 0
res['results'] += out res['results'] += out
res['msg'] += err res['msg'] += err
@ -273,7 +268,6 @@ def latest(module, items, repoq, yum_basecmd):
res['results'] = '' res['results'] = ''
res['msg'] = '' res['msg'] = ''
res['changed'] = False res['changed'] = False
res['failed'] = False
res['rc'] = 0 res['rc'] = 0
for spec in items: for spec in items: