def __virtual__():
    if __grains__['kernel'] == 'DragonFly':
        return __virtualname__
    if __grains__['os'] == 'FreeBSD' and float(__grains__['osrelease']) >= 10:
        return __virtualname__
    if __grains__['os'] == 'FreeBSD' and \
            float(__grains__['osmajorrelease']) == 9:
        providers = {}
        if 'providers' in __opts__:
            providers = __opts__['providers']
        log.debug('__opts__.providers: {0}'.format(providers))
        if providers and 'pkg' in providers and providers['pkg'] == 'pkgng':
            log.debug('Configuration option \'providers:pkg\' is set to '
                '\'pkgng\', using \'pkgng\' in favor of \'freebsdpkg\'.')
            return __virtualname__
    return (False,
            'The pkgng execution module cannot be loaded: only available '
            'on FreeBSD 10 or FreeBSD 9 with providers.pkg set to pkgng.')
Load as 'pkg' on FreeBSD 10 and greater.
dataset/ETHPy150Open saltstack/salt/salt/modules/pkgng.py/__virtual__