mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updates due to reviewer suggestions
This commit is contained in:
parent
bea424c18d
commit
75269c4ae2
1 changed files with 2 additions and 4 deletions
|
@ -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.")
|
||||
|
|
Loading…
Add table
Reference in a new issue