mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
pkg.uptodate: Pass kwargs to pkg.list_upgrades
This resolves an edge case in which the "fromrepo" argument is passed to the pkg.uptodate state. We pass through the kwargs to pkg.upgrade, but do not pass the same kwargs to list_upgrades, resulting in inconsistent results.
This commit is contained in:
parent
de90b35d2b
commit
ea726d11c8
1 changed files with 7 additions and 2 deletions
|
@ -1637,14 +1637,19 @@ def uptodate(name, refresh=False, **kwargs):
|
|||
ret['comment'] = 'State pkg.uptodate is not available'
|
||||
return ret
|
||||
|
||||
# emerge --update doesn't appear to support repo notation
|
||||
if 'fromrepo' in kwargs and __grains__['os'] == 'Gentoo':
|
||||
ret['comment'] = '\'fromrepo\' argument not supported on this platform'
|
||||
return ret
|
||||
|
||||
if isinstance(refresh, bool):
|
||||
try:
|
||||
packages = __salt__['pkg.list_upgrades'](refresh=refresh)
|
||||
packages = __salt__['pkg.list_upgrades'](refresh=refresh, **kwargs)
|
||||
except Exception as e:
|
||||
ret['comment'] = str(e)
|
||||
return ret
|
||||
else:
|
||||
ret['comment'] = 'refresh must be a boolean.'
|
||||
ret['comment'] = 'refresh must be either True or False'
|
||||
return ret
|
||||
|
||||
if not packages:
|
||||
|
|
Loading…
Add table
Reference in a new issue