From b3ec97cd362e754490ec3804249d9b57095f4552 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 26 Oct 2018 11:13:03 +0300 Subject: [PATCH] swupd: fail in case of an incorrect bundle (#45993) For some strange reasons the 'swupd' module does not fail if I specify a non-existing bundle like "xxx". This is inconsistent with other modules, for example 'dnf'. The end result is that if someone uses the 'package' module, the result is inconsistent across OSes: for Fedora trying to install an non-existing module fails, bot for Clear Linux it just prints a warning and succeeds. This patch fixes the inconsistent behavior. With this patch 'swupd' will fail if one tries to install a bundle that does not exist. Signed-off-by: Artem Bityutskiy --- lib/ansible/modules/packaging/os/swupd.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/ansible/modules/packaging/os/swupd.py b/lib/ansible/modules/packaging/os/swupd.py index e5fdafa6d9a..b89354557b6 100644 --- a/lib/ansible/modules/packaging/os/swupd.py +++ b/lib/ansible/modules/packaging/os/swupd.py @@ -197,10 +197,6 @@ class Swupd(object): self.msg = "Bundle %s installed" % bundle return - if self.rc == 18: - self.msg = "Bundle name %s is invalid" % bundle - return - self.failed = True self.msg = "Failed to install bundle %s" % bundle