Updates due to reviewer suggestions

This commit is contained in:
David Murphy 2023-07-20 09:46:20 -06:00 committed by Megan Wilhite
parent bea424c18d
commit 75269c4ae2

View file

@ -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.")