1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

apt_get: add warning for force_apt_get (#33994)

This fix adds strict check for package manager binary checking in given
path.

Fixes: #32940

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-12-20 10:09:15 +05:30 committed by Adam Miller
parent 51315c498d
commit bc91258124

View file

@ -753,6 +753,12 @@ def upgrade(m, mode="yes", force=False, default_release=None,
else:
force_yes = ''
if apt_cmd is None:
if use_apt_get:
apt_cmd = APT_GET_CMD
else:
m.fail_json(msg="Unable to find APTITUDE in path. Please make sure "
"to have APTITUDE in path or use 'force_apt_get=True'")
apt_cmd_path = m.get_bin_path(apt_cmd, required=True)
cmd = '%s -y %s %s %s %s' % (apt_cmd_path, dpkg_options,