%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/dnsmasq.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zddl
mZddlm
Z
eje�Zd�Zd�Zd�Zd	ed
�Zd	d�Zd�ZdS(
u
Module for managing dnsmasq
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionError(tsixcC@s tjjj�rtdfStS(u*
    Only work on POSIX-like systems.
    uMdnsmasq execution module cannot be loaded: only works on non-Windows systems.(tsalttutilstplatformt
is_windowstFalsetTrue(((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pyt__virtual__scC@s4d}td|�j�}|dj�}|dS(u{
    Shows installed version of dnsmasq.

    CLI Example:

    .. code-block:: bash

        salt '*' dnsmasq.version
    u
dnsmasq -vucmd.runii(t__salt__t
splitlinestsplit(tcmdtouttcomps((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pytversion#s
cC@s\d}td|�j�}|dj�}|d}|dj�}i|d6|dd6S(	u�
    Shows installed version of dnsmasq and compile options.

    CLI Example:

    .. code-block:: bash

        salt '*' dnsmasq.fullversion
    u
dnsmasq -vucmd.runiiiuversioniucompile options(RR
R(RRRtversion_num((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pytfullversion3s


u/etc/dnsmasq.confc	
K@s�t|�}|g}|tkr�d|kr�x�tj|d�D]�}|jd�r\qAn|jd�rqqAn|jd�r�qAn|jd�r�|jd�r�qAn|jdj|d|��qAWni}x�|D]�}|jd�r�q�n||||<||kr�t||t	j
�rpxh|D]<}tdd	|d
dj|�dd
j|||��q-Wq�td|d
j|||��q�td|d
j|||��q�W|S(u�
    Sets a value or a set of values in the specified file. By default, if
    conf-dir is configured in this file, salt will attempt to set the option
    in any file inside the conf-dir where it has already been enabled. If it
    does not find it inside any files, it will append it to the main config
    file. Setting follow to False will turn off this behavior.

    If a config option currently appears multiple times (such as dhcp-host,
    which is specified at least once per host), the new option will be added
    to the end of the main config file (and not to any includes). If you need
    an option added to a specific include file, specify it as the config_file.

    :param string config_file: config file where settings should be updated / added.
    :param bool follow: attempt to set the config option inside any file within
        the ``conf-dir`` where it has already been enabled.
    :param kwargs: key value pairs that contain the configuration settings that you
        want set.

    CLI Examples:

    .. code-block:: bash

        salt '*' dnsmasq.set_config domain=mydomain.com
        salt '*' dnsmasq.set_config follow=False domain=mydomain.com
        salt '*' dnsmasq.set_config config_file=/etc/dnsmasq.conf domain=mydomain.com
    uconf-diru.u~ubaku#u{0}/{1}u__ufile.sedtpathtbeforeu^{0}=.*tafteru{0}={1}ufile.append(t
get_configR
tostlistdirt
startswithtendswithtappendtformatt
isinstanceRtstring_typesR(	tconfig_filetfollowtkwargstdnsoptstincludestfilenamet
ret_kwargstkeytconfig((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pyt
set_configFs:	$



cC@s�t|�}d|kr�x�tj|d�D]w}|jd�rGq,n|jd�r\q,n|jd�r�|jd�r�q,n|jtdj|d|���q,Wn|S(uH
    Dumps all options from the config file.

    config_file
        The location of the config file from which to obtain contents.
        Defaults to ``/etc/dnsmasq.conf``.

    CLI Examples:

    .. code-block:: bash

        salt '*' dnsmasq.get_config
        salt '*' dnsmasq.get_config config_file=/etc/dnsmasq.conf
    uconf-diru.u~u#u{0}/{1}(t_parse_dnamasqRRRRtupdateR(R!R$R&((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pyR�sc	C@spi}tjj|�s0tdj|���ntjjj|d��"}x|D]}tjj	j
|�}|j�sqRn|jd�r�qRnd|kr8|j
d�}|d|krt||dtj�r�||d}|g||d<n||dj|dj��qb|dj�||d<qRd|krQg|d<n|dj|�qRWWdQX|S(	uH
    Generic function for parsing dnsmasq files including includes.
    uError: No such file '{0}'uru#u=iiuunparsedN(RRtisfileRRRRtfilestfopentstringutilst
to_unicodetstripRRRRR R(R&tfileoptstfp_tlineRttemp((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pyR+�s.
"
(t__doc__t
__future__RRRtloggingRtsalt.utils.filesRtsalt.utils.platformtsalt.exceptionsRtsalt.extRt	getLoggert__name__tlogRRRR
R*RR+(((s8/usr/lib/python2.7/site-packages/salt/modules/dnsmasq.pyt<module>s	
		@

Zerion Mini Shell 1.0