mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #31793 from xopher-mc/fix_sles_state_service_module
fixing init system detection on sles 11, refs #31617
This commit is contained in:
commit
1386b72bbf
@ -60,14 +60,19 @@ 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 >= 12:
|
||||
return (False, 'Cannot load rh_service module on SUSE >= 12')
|
||||
|
||||
if __grains__['os'] == 'Fedora':
|
||||
if osrelease > 15:
|
||||
return (False, 'Cannot load rh_service module on Fedora >= 15')
|
||||
|
Loading…
Reference in New Issue
Block a user