%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	ddl
Z	ddlZ	ddlZ	ej
e�Zidd6ZdZd�Zd�Zed	�Zd
�Zd�Zd�Zd
d�Zd
d�ZdS(u
Support for Debconf
i(tabsolute_importtprint_functiontunicode_literalsNusetuset_udebconfcC@sCtddkrtdfStjjjd�dkr?tdfStS(ub
    Confirm this module is on a Debian based system and that debconf-utils
    is installed.
    u	os_familyuDebianu@The debconfmod module could not be loaded: unsupported OS familyudebconf-get-selectionsuJThe debconfmod module could not be loaded: debconf-utils is not installed.N(t
__grains__tFalsetsalttutilstpathtwhichtNonet__virtualname__(((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pyt__virtual__s


cC@sd}tj||�}|S(u"
    Unpack the debconf lines
    uX(?ms)^(?P<package>[^#]\S+)[	 ]+(?P<question>\S+)[	 ]+(?P<type>\S+)[	 ]+(?P<value>[^
]*)$(tretfindall(touttrexptlines((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pyt
_unpack_lines,sc
C@s�i}d}td|�}t|�}xQ|D]I}|\}}}}	|sS|	r/|j|g�j|||	g�q/q/W|S(u�
    Answers to debconf questions for all packages in the following format::

        {'package': [['question', 'type', 'value'], ...]}

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.get_selections
    udebconf-get-selectionsucmd.run_stdout(t__salt__Rt
setdefaulttappend(
t
fetchemptyt
selectionstcmdRRtlinetpackagetquestionttype_tvalue((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pytget_selections9s
cC@st�}|j|�}|S(u
    Answers to debconf questions for a package in the following format::

        [['question', 'type', 'value'], ...]

    If debconf doesn't know about a package, we return None.

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.show <package name>
    (Rtget(tnameRtresult((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pytshowVs	cC@s'dj|�}td|dt�dS(u8
    Execute the set selections command for debconf
    udebconf-set-selections {0}ucmd.run_stdouttpython_shellN(tformatRR(RR((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pyt	_set_filejscG@s�|r%dj|ft|��}ntjjjdddt�\}}dj||||�}tj	|tjj
j|��tj|�t
|�tj|�tS(u�
    Set answers to debconf questions for a package.

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.set <package> <question> <type> <value> [<value> ...]
    u tprefixusalt-tclose_fdu{0} {1} {2} {3}(tjointtupleRRtfilestmkstempRR#tostwritetstringutilstto_bytestcloseR$tunlinktTrue(RRttypeRtextratfd_tfnameR((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pytset_ss$


ubasecK@sDtdd|ddd|d|d|d||�}t|||�S(	u�
    Set answers to debconf questions from a template.

    path
        location of the file containing the package selections

    template
        template format

    context
        variables to add to the template environment

    default
        default values for the template environment

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.set_template salt://pathto/pkg.selections.jinja jinja None None

    ucp.get_templateRtdestttemplatetsaltenvtcontexttdefaultsN(RR	tset_file(RR8R:R;R9tkwargs((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pytset_template�s
	cK@sGd|kr|jd�ntd||�}|rCt|�tStS(u�
    Set answers to debconf questions from a file.

    CLI Example:

    .. code-block:: bash

        salt '*' debconf.set_file salt://pathto/pkg.selections
    u__env__u
cp.cache_file(tpopRR$R1R(RR9R=((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pyR<�s

(t__doc__t
__future__RRRtloggingR+Rtsalt.utils.pathRtsalt.utils.filestsalt.utils.stringutilstsalt.utils.versionst	getLoggert__name__tlogt__func_alias__R
RRR1RR!R$R6R>R<(((s;/usr/lib/python2.7/site-packages/salt/modules/debconfmod.pyt<module>s(
		
				$

Zerion Mini Shell 1.0