apt - make errors more transparent (#70099)
Include error from apt Python library in module error output Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
This commit is contained in:
parent
73139df36c
commit
7d7f15fc9b
2 changed files with 6 additions and 4 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- apt - include exception message from apt python library in error output
|
|
@ -1247,10 +1247,10 @@ def main():
|
|||
elif p['state'] == 'absent':
|
||||
remove(module, packages, cache, p['purge'], force=force_yes, dpkg_options=dpkg_options, autoremove=autoremove)
|
||||
|
||||
except apt.cache.LockFailedException:
|
||||
module.fail_json(msg="Failed to lock apt for exclusive operation")
|
||||
except apt.cache.FetchFailedException:
|
||||
module.fail_json(msg="Could not fetch updated apt files")
|
||||
except apt.cache.LockFailedException as lockFailedException:
|
||||
module.fail_json(msg="Failed to lock apt for exclusive operation: %s" % lockFailedException)
|
||||
except apt.cache.FetchFailedException as fetchFailedException:
|
||||
module.fail_json(msg="Could not fetch updated apt files: %s" % fetchFailedException)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue