Merge pull request #2926 from mattclay/apt-unsafe

Split shell command to avoid use_unsafe_shell.
This commit is contained in:
Matt Davis 2016-03-08 04:56:51 +00:00
commit 7d2fd4e944

View file

@ -582,7 +582,8 @@ def main():
if module.check_mode: if module.check_mode:
module.fail_json(msg="python-apt must be installed to use check mode. If run normally this module can autoinstall it") module.fail_json(msg="python-apt must be installed to use check mode. If run normally this module can autoinstall it")
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', check_rc=True)
module.run_command('apt-get install python-apt -y -q', check_rc=True)
global apt, apt_pkg global apt, apt_pkg
import apt import apt
import apt.debfile import apt.debfile