mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
now module fails gracefully instead of stacktrace when trying to install missing deb file
This commit is contained in:
parent
8f197aed48
commit
4124f8c381
1 changed files with 4 additions and 1 deletions
|
@ -363,7 +363,10 @@ def install_deb(m, debs, cache, force, install_recommends, dpkg_options):
|
|||
deps_to_install = []
|
||||
pkgs_to_install = []
|
||||
for deb_file in debs.split(','):
|
||||
try:
|
||||
pkg = apt.debfile.DebPackage(deb_file)
|
||||
except SystemError, e:
|
||||
m.fail_json(msg="Error: %s\nSystem Error: %s" % (pkg._failure_string,str(e)))
|
||||
|
||||
# Check if it's already installed
|
||||
if pkg.compare_to_version_in_cache() == pkg.VERSION_SAME:
|
||||
|
|
Loading…
Reference in a new issue