コード例 #1
0
ファイル: win_status.py プロジェクト: morinap/salt-1
def __virtual__():
    '''
    Only works on Windows systems with WMI and WinAPI
    '''
    if not salt.utils.platform.is_windows():
        return False, 'win_status.py: Requires Windows'

    if not HAS_WMI:
        return False, 'win_status.py: Requires WMI and WinAPI'

    if not HAS_PSUTIL:
        return False, 'win_status.py: Requires psutil'

    # Namespace modules from `status.py`
    global ping_master, time_
    ping_master = _namespaced_function(ping_master, globals())
    time_ = _namespaced_function(time_, globals())

    return __virtualname__
コード例 #2
0
def __virtual__():
    """Load only on Windows and only if Apply_LGPO_Delta is present."""
    if not is_windows():
        return False
    if not HAS_WINDOWS_MODULES:
        return (False,
                '{0}: Required modules failed to load'.format(__virtualname__))

    global _write_regpol_data
    _write_regpol_data = _namespaced_function(_write_regpol_data, globals())

    return __virtualname__
コード例 #3
0
def __virtual__():
    '''
    Only works on Windows systems
    '''
    if not salt.utils.platform.is_windows():
        return False, "Module win_network: Only available on Windows"

    if not HAS_DEPENDENCIES:
        return False, "Module win_network: Missing dependencies"

    global wol, get_hostname, interface, interface_ip, subnets6, ip_in_subnet
    global convert_cidr, calc_net, get_fqdn, ifacestartswith, iphexval

    wol = _namespaced_function(wol, globals())
    get_hostname = _namespaced_function(get_hostname, globals())
    interface = _namespaced_function(interface, globals())
    interface_ip = _namespaced_function(interface_ip, globals())
    subnets6 = _namespaced_function(subnets6, globals())
    ip_in_subnet = _namespaced_function(ip_in_subnet, globals())
    convert_cidr = _namespaced_function(convert_cidr, globals())
    calc_net = _namespaced_function(calc_net, globals())
    get_fqdn = _namespaced_function(get_fqdn, globals())
    ifacestartswith = _namespaced_function(ifacestartswith, globals())
    iphexval = _namespaced_function(iphexval, globals())

    return __virtualname__