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:
parent
51315c498d
commit
bc91258124
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue