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)
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue