mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #27241 from jfindlay/yumwarn
osrelease is only an integer for fedora
This commit is contained in:
commit
e4a5b004ae
1 changed files with 3 additions and 12 deletions
|
@ -80,19 +80,10 @@ def _yum():
|
|||
'''
|
||||
contextkey = 'yum_bin'
|
||||
if contextkey not in __context__:
|
||||
try:
|
||||
osrelease = int(__grains__['osrelease'])
|
||||
except ValueError:
|
||||
log.warning(
|
||||
'Unexpected osrelease grain \'{0}\', please report this'
|
||||
.format(__grains__['osrelease'])
|
||||
)
|
||||
__context__[contextkey] = 'yum'
|
||||
if 'fedora' in __grains__['os'].lower() and __grains__['osrelease'] >= 22:
|
||||
__context__[contextkey] = 'dnf'
|
||||
else:
|
||||
if 'fedora' in __grains__['os'].lower() and osrelease >= 22:
|
||||
__context__[contextkey] = 'dnf'
|
||||
else:
|
||||
__context__[contextkey] = 'yum'
|
||||
__context__[contextkey] = 'yum'
|
||||
return __context__[contextkey]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue