fix lint errors and code factorization

This commit is contained in:
Nicolas Lafont 2018-10-20 11:31:37 +02:00 committed by rallytime
parent 8aa35989ab
commit 819c46cb87
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -81,20 +81,11 @@ def __virtual__():
osrelease_major = __grains__.get('osrelease_info', [0])[0]
if __grains__['os'] == 'XenServer':
if __grains__['os'] in ('XenServer', 'XCP-ng'):
if osrelease_major >= 7:
return (
False,
'XenServer >= 7 uses systemd, will not load rh_service.py '
'as virtual \'service\''
)
return __virtualname__
if __grains__['os'] == 'XCP-ng':
if osrelease_major >= 7:
return (
False,
'XCP-ng >= 7 uses systemd, will not load rh_service.py '
'XenServer and XCP-ng >= 7 use systemd, will not load rh_service.py '
'as virtual \'service\''
)
return __virtualname__