Do not install python-apt in check mode.

pull/18777/head
Matt Clay 9 years ago
parent b5c9945485
commit 4288150270

@ -579,6 +579,8 @@ def main():
module.run_command_environ_update = APT_ENV_VARS module.run_command_environ_update = APT_ENV_VARS
if not HAS_PYTHON_APT: if not HAS_PYTHON_APT:
if module.check_mode:
module.fail_json(msg="python-apt must be installed to use check mode")
try: try:
module.run_command('apt-get update && apt-get install python-apt -y -q --force-yes', use_unsafe_shell=True, check_rc=True) module.run_command('apt-get update && apt-get install python-apt -y -q --force-yes', use_unsafe_shell=True, check_rc=True)
global apt, apt_pkg global apt, apt_pkg

Loading…
Cancel
Save