Skip to content

Commit

Permalink
Properly report install failures from dnf module (#49760)
Browse files Browse the repository at this point in the history
Reporting of install failures was improperly guarded behind a list of
packages to install when the first element changed in a list was found.
This lead to the dnf module silently failing at times when it should not
fail.

Fixes issue 49759
  • Loading branch information
greg-hellings authored and ansibot committed Dec 13, 2018
1 parent 69988cf commit af5d84b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/modules/packaging/os/dnf.py
Expand Up @@ -1087,10 +1087,10 @@ def ensure(self):
self.module.exit_json(**response)
else:
response['changed'] = True
if failure_response['failures']:
failure_response['msg'] = 'Failed to install some of the specified packages',
self.module.fail_json(**failure_response)
if self.module.check_mode:
if failure_response['failures']:
failure_response['msg'] = 'Failed to install some of the specified packages',
self.module.fail_json(**failure_response)
response['msg'] = "Check mode: No changes made, but would have if not in check mode"
self.module.exit_json(**response)

Expand Down

0 comments on commit af5d84b

Please sign in to comment.