mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Properly report install failures from dnf module (#49760)
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
This commit is contained in:
parent
69988cfca0
commit
af5d84b70b
1 changed files with 3 additions and 3 deletions
|
@ -1087,10 +1087,10 @@ class DnfModule(YumDnf):
|
||||||
self.module.exit_json(**response)
|
self.module.exit_json(**response)
|
||||||
else:
|
else:
|
||||||
response['changed'] = True
|
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 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"
|
response['msg'] = "Check mode: No changes made, but would have if not in check mode"
|
||||||
self.module.exit_json(**response)
|
self.module.exit_json(**response)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue