mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
modules.rh_service.__virtual__: handle SUSE osrelease as num
This commit is contained in:
parent
d7ab7bf51f
commit
9975508f86
1 changed files with 3 additions and 5 deletions
|
@ -60,16 +60,14 @@ def __virtual__():
|
|||
if __grains__['os'] in enable:
|
||||
if __grains__['os'] == 'XenServer':
|
||||
return __virtualname__
|
||||
if __grains__['os'] == 'SUSE':
|
||||
if str(__grains__['osrelease']).startswith('11'):
|
||||
return __virtualname__
|
||||
else:
|
||||
return (False, 'Cannot load rh_service module: on SUSE >= 11')
|
||||
try:
|
||||
osrelease = float(__grains__.get('osrelease', 0))
|
||||
except ValueError:
|
||||
return (False, 'Cannot load rh_service module: '
|
||||
'osrelease grain, {0}, not a float,'.format(osrelease))
|
||||
if __grains__['os'] == 'SUSE':
|
||||
if osrelease > 11:
|
||||
return (False, 'Cannot load rh_service module on SUSE >= 11')
|
||||
if __grains__['os'] == 'Fedora':
|
||||
if osrelease > 15:
|
||||
return (False, 'Cannot load rh_service module on Fedora >= 15')
|
||||
|
|
Loading…
Add table
Reference in a new issue