Commit a28bcd60 by jctanner

Merge pull request #4617 from resmo/feature/python-apt

apt: autoinstall python-apt if apt or apt_pkg is not available
parents f820e8e7 a10e017d
......@@ -344,7 +344,13 @@ def main():
)
if not HAS_PYTHON_APT:
module.fail_json(msg="Could not import python modules: apt, apt_pkg. Please install python-apt package.")
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.")
global APTITUDE_CMD
APTITUDE_CMD = module.get_bin_path("aptitude", False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment