def __virtual__():
    '''
    Only work on select distros which still use Red Hat's /usr/bin/service for
    management of either sysvinit or a hybrid sysvinit/upstart init system.
    '''
    # Disable when booted with systemd
    if __utils__['systemd.booted'](__context__):
        return (False, 'The rh_service execution module failed to load: this system was booted with systemd.')

    # Enable on these platforms only.
    enable = set((
        'XenServer',
        'XCP-ng',
        'RedHat',
        'CentOS',
        'ScientificLinux',
        'CloudLinux',
        'Amazon',
        'Fedora',
        'ALT',
        'OEL',
        'SUSE  Enterprise Server',
        'SUSE',
        'McAfee  OS Server',
        'VirtuozzoLinux'
    ))
    if __grains__['os'] in enable:

        if __grains__['os'] == 'SUSE':
            if six.text_type(__grains__['osrelease']).startswith('11'):
                return __virtualname__
            else:
                return (False, 'Cannot load rh_service module on SUSE > 11')

        osrelease_major = __grains__.get('osrelease_info', [0])[0]

        if __grains__['os'] in ('XenServer', 'XCP-ng'):
            if osrelease_major >= 7:
                return (
                    False,
                    'XenServer and XCP-ng >= 7 use systemd, will not load rh_service.py '
                    'as virtual \'service\''
                )
            return __virtualname__

        if __grains__['os'] == 'Fedora':
            if osrelease_major >= 15:
                return (
                    False,
                    'Fedora >= 15 uses systemd, will not load rh_service.py '
                    'as virtual \'service\''
                )
        if __grains__['os'] in ('RedHat', 'CentOS', 'ScientificLinux', 'OEL', 'CloudLinux'):
            if osrelease_major >= 7:
                return (
                    False,
                    'RedHat-based distros >= version 7 use systemd, will not '
                    'load rh_service.py as virtual \'service\''
                )
        return __virtualname__
    return (False, 'Cannot load rh_service module: OS not in {0}'.format(enable))
def __virtual__ ( ) : if __utils__ [ 'systemd.booted' ] ( __context__ ) : return ( False , 'The rh_service execution module failed to load: this system was booted with systemd.' ) enable = set ( ( 'XenServer' , 'XCP-ng' , 'RedHat' , 'CentOS' , 'ScientificLinux' , 'CloudLinux' , 'Amazon' , 'Fedora' , 'ALT' , 'OEL' , 'SUSE  Enterprise Server' , 'SUSE' , 'McAfee  OS Server' , 'VirtuozzoLinux' ) ) if __grains__ [ 'os' ] in enable : if __grains__ [ 'os' ] == 'SUSE' : if six . text_type ( __grains__ [ 'osrelease' ] ) . startswith ( '11' ) : return __virtualname__ else : return ( False , 'Cannot load rh_service module on SUSE > 11' ) osrelease_major = __grains__ . get ( 'osrelease_info' , [ 0 ] ) [ 0 ] if __grains__ [ 'os' ] in ( 'XenServer' , 'XCP-ng' ) : if osrelease_major >= 7 : return ( False , 'XenServer and XCP-ng >= 7 use systemd, will not load rh_service.py ' 'as virtual \'service\'' ) return __virtualname__ if __grains__ [ 'os' ] == 'Fedora' : if osrelease_major >= 15 : return ( False , 'Fedora >= 15 uses systemd, will not load rh_service.py ' 'as virtual \'service\'' ) if __grains__ [ 'os' ] in ( 'RedHat' , 'CentOS' , 'ScientificLinux' , 'OEL' , 'CloudLinux' ) : if osrelease_major >= 7 : return ( False , 'RedHat-based distros >= version 7 use systemd, will not ' 'load rh_service.py as virtual \'service\'' ) return __virtualname__ return ( False , 'Cannot load rh_service module: OS not in {0}' . format ( enable ) )
Only work on select distros which still use Red Hat's /usr/bin/service for
    management of either sysvinit or a hybrid sysvinit/upstart init system.