From c8bd14925d9258c4fd676fda5a3830ef01e932c9 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Tue, 7 Jan 2014 14:43:22 -0500 Subject: [PATCH] Fixes #5369 Do not pass --force-yes to aptitude --- library/packaging/apt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/packaging/apt b/library/packaging/apt index 409eb898e6..a7a2589889 100644 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -324,13 +324,17 @@ def upgrade(m, mode="yes", force=False, upgrade_command = "safe-upgrade" if force: - force_yes = '--force-yes' + if apt_cmd == APT_GET_CMD: + force_yes = '--force-yes' + else: + force_yes = '' else: force_yes = '' 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, force_yes, check_arg, upgrade_command) + open("/tmp/awx.log", "a").write("cmd: %s\n" % cmd) rc, out, err = m.run_command(cmd) if rc: m.fail_json(msg="'%s %s' failed: %s" % (apt_cmd, upgrade_command, err), stdout=out)