From a6ec6c31758dd93fb496e71f46e18651056023dc Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 Sep 2019 14:29:36 -0500 Subject: [PATCH] Fixes #56832: Remove warning when falling back to apt-get if aptitude is missing. (#61782) --- changelogs/fragments/56832-remove-aptitude-warning.yml | 2 ++ lib/ansible/modules/packaging/os/apt.py | 1 - test/integration/targets/apt/tasks/upgrade.yml | 8 -------- 3 files changed, 2 insertions(+), 9 deletions(-) create mode 100644 changelogs/fragments/56832-remove-aptitude-warning.yml diff --git a/changelogs/fragments/56832-remove-aptitude-warning.yml b/changelogs/fragments/56832-remove-aptitude-warning.yml new file mode 100644 index 00000000000..4752fd198e3 --- /dev/null +++ b/changelogs/fragments/56832-remove-aptitude-warning.yml @@ -0,0 +1,2 @@ +bugfixes: + - Remove the unnecessary warning about aptitude not being installed (https://github.com/ansible/ansible/issues/56832). diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index c9728ae7ba3..4ad94a07268 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -1077,7 +1077,6 @@ def main(): use_apt_get = p['force_apt_get'] if not use_apt_get and not APTITUDE_CMD: - module.warn("Could not find aptitude. Using apt-get instead") use_apt_get = True updated_cache = False diff --git a/test/integration/targets/apt/tasks/upgrade.yml b/test/integration/targets/apt/tasks/upgrade.yml index c76f552f754..cf747c8108a 100644 --- a/test/integration/targets/apt/tasks/upgrade.yml +++ b/test/integration/targets/apt/tasks/upgrade.yml @@ -35,14 +35,6 @@ when: - force_apt_get - - name: check that warning is given when aptitude not found and force_apt_get not set - assert: - that: - - "'Could not find aptitude. Using apt-get instead' in upgrade_result.warnings[0]" - when: - - not aptitude_present - - not force_apt_get - - name: check that old version upgraded correctly assert: that: