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>
pull/34078/head
Abhijeet Kasurde 7 years ago committed by Adam Miller
parent 51315c498d
commit bc91258124

@ -753,6 +753,12 @@ def upgrade(m, mode="yes", force=False, default_release=None,
else: else:
force_yes = '' 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) apt_cmd_path = m.get_bin_path(apt_cmd, required=True)
cmd = '%s -y %s %s %s %s' % (apt_cmd_path, dpkg_options, cmd = '%s -y %s %s %s %s' % (apt_cmd_path, dpkg_options,

Loading…
Cancel
Save