From 75269c4ae22cce7cef1e681e2b1625368d6e18f5 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 20 Jul 2023 09:46:20 -0600 Subject: [PATCH] Updates due to reviewer suggestions --- salt/modules/yumpkg.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index a3688c8c57d..31129855fc7 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -1060,9 +1060,7 @@ def list_upgrades(refresh=True, **kwargs): cmd = ["--quiet"] cmd.extend(options) - cmd.extend( - ["list", "upgrades" if _yum() in ("dnf", "dnf5") else "updates"] - ) + cmd.extend(["list", "upgrades" if _yum() in ("dnf", "dnf5") else "updates"]) out = _call_yum(cmd, ignore_retcode=True) if out["retcode"] != 0 and "Error:" in out: return {} @@ -3505,7 +3503,7 @@ def services_need_restart(**kwargs): salt '*' pkg.services_need_restart """ - if _yum() == "dnf": + if _yum() != "dnf": raise CommandExecutionError("dnf is required to list outdated services.") if not salt.utils.systemd.booted(__context__): raise CommandExecutionError("systemd is required to list outdated services.")