Merge pull request #785 from bcoca/apt_deb_missing

now module fails gracefully instead of stacktrace
This commit is contained in:
Brian Coca 2015-02-25 10:38:29 -05:00
commit 2fcc93e5b3

View file

@ -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(','):
pkg = apt.debfile.DebPackage(deb_file)
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: