mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
simplify checking the refresh paramater
This commit is contained in:
parent
db0e0de2fd
commit
644b14c273
1 changed files with 8 additions and 8 deletions
|
@ -85,7 +85,7 @@ def list_upgrades(refresh=True):
|
|||
|
||||
salt '*' pkg.list_upgrades
|
||||
'''
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
ret = {}
|
||||
call = __salt__['cmd.run_all'](
|
||||
|
@ -199,7 +199,7 @@ def info_available(*names, **kwargs):
|
|||
names = sorted(list(set(names)))
|
||||
|
||||
# Refresh db before extracting the latest package
|
||||
if salt.utils.is_true(kwargs.pop('refresh', True)):
|
||||
if kwargs.pop('refresh', True):
|
||||
refresh_db()
|
||||
|
||||
pkg_info = []
|
||||
|
@ -780,7 +780,7 @@ def install(name=None,
|
|||
{'<package>': {'old': '<old-version>',
|
||||
'new': '<new-version>'}}
|
||||
'''
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
|
||||
try:
|
||||
|
@ -884,7 +884,7 @@ def upgrade(refresh=True):
|
|||
'comment': '',
|
||||
}
|
||||
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
old = list_pkgs()
|
||||
cmd = _zypper('update', '--auto-agree-with-licenses')
|
||||
|
@ -1259,7 +1259,7 @@ def list_patterns(refresh=False):
|
|||
|
||||
salt '*' pkg.list_patterns
|
||||
'''
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
|
||||
return _get_patterns()
|
||||
|
@ -1293,7 +1293,7 @@ def search(criteria, refresh=False):
|
|||
|
||||
salt '*' pkg.search <criteria>
|
||||
'''
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
|
||||
doc = dom.parseString(__salt__['cmd.run'](_zypper('--xmlout', 'se', criteria),
|
||||
|
@ -1348,7 +1348,7 @@ def list_products(all=False, refresh=False):
|
|||
salt '*' pkg.list_products
|
||||
salt '*' pkg.list_products all=True
|
||||
'''
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
|
||||
ret = list()
|
||||
|
@ -1399,7 +1399,7 @@ def download(refresh=False, *packages):
|
|||
if not packages:
|
||||
raise CommandExecutionError("No packages has been specified.")
|
||||
|
||||
if salt.utils.is_true(refresh):
|
||||
if refresh:
|
||||
refresh_db()
|
||||
|
||||
doc = dom.parseString(__salt__['cmd.run'](
|
||||
|
|
Loading…
Add table
Reference in a new issue