deal with more failures when apt module fails to instantiate pkg fixes #1499

pull/18777/head
Brian Coca 9 years ago committed by Matt Clay
parent 4b6471d5e7
commit 9ad712018c

@ -403,8 +403,6 @@ def install_deb(m, debs, cache, force, install_recommends, dpkg_options):
for deb_file in debs.split(','): for deb_file in debs.split(','):
try: try:
pkg = apt.debfile.DebPackage(deb_file) pkg = apt.debfile.DebPackage(deb_file)
except SystemError, e:
m.fail_json(msg="System Error: %s" % str(e))
# Check if it's already installed # Check if it's already installed
if pkg.compare_to_version_in_cache() == pkg.VERSION_SAME: if pkg.compare_to_version_in_cache() == pkg.VERSION_SAME:
@ -417,6 +415,9 @@ def install_deb(m, debs, cache, force, install_recommends, dpkg_options):
# to install so they're all done in one shot # to install so they're all done in one shot
deps_to_install.extend(pkg.missing_deps) deps_to_install.extend(pkg.missing_deps)
except Exception, e:
m.fail_json(msg="Unable to install package: %s" % str(e))
# and add this deb to the list of packages to install # and add this deb to the list of packages to install
pkgs_to_install.append(deb_file) pkgs_to_install.append(deb_file)

Loading…
Cancel
Save