Fixes #5369 Do not pass --force-yes to aptitude
This commit is contained in:
parent
dee960716b
commit
c8bd14925d
1 changed files with 5 additions and 1 deletions
|
@ -324,13 +324,17 @@ def upgrade(m, mode="yes", force=False,
|
||||||
upgrade_command = "safe-upgrade"
|
upgrade_command = "safe-upgrade"
|
||||||
|
|
||||||
if force:
|
if force:
|
||||||
force_yes = '--force-yes'
|
if apt_cmd == APT_GET_CMD:
|
||||||
|
force_yes = '--force-yes'
|
||||||
|
else:
|
||||||
|
force_yes = ''
|
||||||
else:
|
else:
|
||||||
force_yes = ''
|
force_yes = ''
|
||||||
|
|
||||||
apt_cmd_path = m.get_bin_path(apt_cmd, required=True)
|
apt_cmd_path = m.get_bin_path(apt_cmd, required=True)
|
||||||
cmd = '%s %s -y %s %s %s %s' % (APT_ENVVARS, apt_cmd_path, dpkg_options,
|
cmd = '%s %s -y %s %s %s %s' % (APT_ENVVARS, apt_cmd_path, dpkg_options,
|
||||||
force_yes, check_arg, upgrade_command)
|
force_yes, check_arg, upgrade_command)
|
||||||
|
open("/tmp/awx.log", "a").write("cmd: %s\n" % cmd)
|
||||||
rc, out, err = m.run_command(cmd)
|
rc, out, err = m.run_command(cmd)
|
||||||
if rc:
|
if rc:
|
||||||
m.fail_json(msg="'%s %s' failed: %s" % (apt_cmd, upgrade_command, err), stdout=out)
|
m.fail_json(msg="'%s %s' failed: %s" % (apt_cmd, upgrade_command, err), stdout=out)
|
||||||
|
|
Loading…
Reference in a new issue