apt: autoinstall python-apt if not available

reviewable/pr18780/r1
Rene Moser 11 years ago
parent 2b20be94e0
commit c2c0729f6e

@ -322,6 +322,12 @@ def main():
) )
if not HAS_PYTHON_APT: if not HAS_PYTHON_APT:
try:
module.run_command('apt-get install python-apt -y -q')
global apt, apt_pkg
import apt
import apt_pkg
except:
module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.") module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.")
global APTITUDE_CMD global APTITUDE_CMD

Loading…
Cancel
Save