call refresh_db with kwargs where possible

This commit is contained in:
Michael Calmer 2022-06-24 09:50:10 +02:00 committed by Daniel Wozniak
parent c899e7a4b0
commit df9fcda537

View file

@ -560,7 +560,7 @@ def list_upgrades(refresh=True, root=None, **kwargs):
salt '*' pkg.list_upgrades
"""
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
ret = dict()
cmd = ["list-updates"]
@ -674,7 +674,7 @@ def info_available(*names, **kwargs):
# Refresh db before extracting the latest package
if kwargs.get("refresh", True):
refresh_db(root)
refresh_db(root, **kwargs)
pkg_info = []
batch = names[:]
@ -1620,7 +1620,7 @@ def install(
'arch': '<new-arch>'}}}
"""
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
try:
pkg_params, pkg_type = __salt__["pkg_resource.parse_targets"](
@ -1905,7 +1905,7 @@ def upgrade(
cmd_update.insert(0, "--no-gpg-checks")
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
if dryrun:
cmd_update.append("--dry-run")
@ -2766,7 +2766,7 @@ def search(criteria, refresh=False, **kwargs):
root = kwargs.get("root", None)
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
cmd = ["search"]
if kwargs.get("match") == "exact":
@ -2917,7 +2917,7 @@ def download(*packages, **kwargs):
refresh = kwargs.get("refresh", False)
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
pkg_ret = {}
for dld_result in (
@ -3069,7 +3069,7 @@ def list_patches(refresh=False, root=None, **kwargs):
salt '*' pkg.list_patches
"""
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
return _get_patches(root=root)
@ -3163,7 +3163,7 @@ def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
salt '*' pkg.resolve_capabilities resolve_capabilities=True w3m_ssl
"""
if refresh:
refresh_db(root)
refresh_db(root, **kwargs)
ret = list()
for pkg in pkgs: