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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlZddlZddlZdZd	Zd
�Zd�Zdd�Zd
�Zd�Zd�Zd�Zd�ZdS(u�
Wrapper module for at(1)

Also, a 'tag' feature has been added to more
easily tag jobs.

:platform:      linux,openbsd,freebsd

.. versionchanged:: 2017.7.0
i(tabsolute_importtprint_functiontunicode_literalsN(tmap(tCommandNotFoundError(tsixuOpenBSDuFreeBSDuatcC@sWtjjj�s$tjjj�r.tdfStjjjd�dkrStdfSt	S(u:
    Most everything has the ability to support at(1)
    u7The at module could not be loaded: unsupported platformuatu7The at module could not be loaded: at command not foundN(
tsalttutilstplatformt
is_windowstis_sunostFalsetpathtwhichtNonet__virtualname__(((s3/usr/lib/python2.7/site-packages/salt/modules/at.pyt__virtual__(s
$

cG@sgtjjj|�}|s3tdj|���n|gt|�}td|gt|�dt�S(u.
    Wrapper to run at(1) or return None.
    u{0}: command not founducmd.run_stdouttpython_shell(	RRRR
Rtformattlistt__salt__R(tbinarytargstcmd((s3/usr/lib/python2.7/site-packages/salt/modules/at.pyt_cmd3scC@s�g}tddkr(tdd�}ntd�}|d#krDdS|dkr[i|d6Stjd	�}xT|j�D]F}d}tddkr�|jd
�\}}|j�}n�tddkr^|jd
�r�qwq�|j�}	dj|	dd!�}
|	d}t	j	t
j|
d�dd!�j�jd�}|j
|	d�|j
|	d�n.tddkr|jd�r�qwq�|j�}	dj|	dd!�}
|	d}t	j	t
j|
d�dd!�j�jd�}|j
|	d�|j
|	d�n�|jd
�\}}|j�}	dj|	dd!�}
t	j	t
j|
�dd!�j�jd�}|j
|	d�|j
|	d�tdd|�}x<|j�D].}|j|�}	|	r�|	j�d}q�q�Wtdtkr�tj|�}nt|�}|rv||ks)||kr�|j
i|d6|dd6|dd6|dd6|d d!6|d"6�q�qw|j
i|d6|dd6|dd6|dd6|d d!6|d"6�qwWi|d6S($u�
    List all queued and running jobs or only those with
    an optional 'tag'.

    CLI Example:

    .. code-block:: bash

        salt '*' at.atq
        salt '*' at.atq [tag]
        salt '*' at.atq [job number]
    u	os_familyuRedHatuatu-luatqu'at.atq' is not available.uujobsu^### SALT: (\w+)u	uosuOpenBSDu Ranku iiiu%b %d, %Y %H:%MiuTiuFreeBSDuDateiu%b %d %H:%M:%S %Z %Yu-cujobudateutimeiuqueueiuuserutagN(t
__grains__RRtretcompilet
splitlinestsplitt
startswithtjointdatetimettimetstrptimet	isoformattappendtmatchtgroupstBSDRt	text_typetint(ttagtjobstoutputtjob_kw_regextlinetjob_tagtjobtspectspecsttmpttimestrtatc_out((s3/usr/lib/python2.7/site-packages/salt/modules/at.pytatq?sp


"&'&%c	G@s�tjjjd�sdS|s8iigd6dd6d6Stjjj|�}|ddkr(t|�dkr�ttt	t
gt|d�dD]}|d	^q����}ii|d6|dd6d6}q�ttt	t
gt�dD]}|d	^q����}ii|d6dd6d6}nmttt	t
gt�dD])}tj
|d	�|krB|d	^qB���}ii|d6dd6d6}tdd
dj|��}|dkr�dS|S(
u�
    Remove jobs from the queue.

    CLI Example:

    .. code-block:: bash

        salt '*' at.atrm <jobid> <jobid> .. <jobid>
        salt '*' at.atrm all
        salt '*' at.atrm all [tag]
    uatu'at.atrm' is not available.uremovedutagujobsiualliujobu-du N(RRRR
Rtdatat	stringifytlenRRtstrR6RR(RR(RtjtoptstrettiR,((s3/usr/lib/python2.7/site-packages/salt/modules/at.pytatrm�s$@"9 2cO@s�t|�dkrigd6Stjjjd�}|s<dSd|krndj|ddj|d��}ndj|d�}||d	g}i|d
6td6}d|kr�|d|d<ntd
||�}|dkr�dS|j
d�rigd6dd6S|jd�r(|j�d}n|jd�rJ|j�d}n|j
�d}tdtkr}ttj|��Stt|��SdS(uc
    Add a job to the queue.

    The 'timespec' follows the format documented in the
    at(1) manpage.

    CLI Example:

    .. code-block:: bash

        salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>]
        salt '*' at.at 12:05am '/sbin/reboot' tag=reboot
        salt '*' at.at '3:05am +3 days' 'bin/myscript' tag=nightly runas=jim
    iujobsuatu'at.at' is not available.utagu### SALT: {0}
{1}u iiustdinupython_shellurunasucmd.runuGarbled timeuinvalid timespecuerroruwarning: commandsucommands will be executeduosN(R9RRRR
RRRRRtendswithRRRRR'R6RR(R)(RtkwargsRtstdinRt
cmd_kwargsR,((s3/usr/lib/python2.7/site-packages/salt/modules/at.pytat�s2&cC@sOtddtj|��}|dkr+dS|dkrKidj|�d6S|S(u�
    Print the at(1) script that will run for the passed job
    id. This is mostly for debugging so the output will
    just be text.

    CLI Example:

    .. code-block:: bash

        salt '*' at.atc <jobid>
    uatu-cu'at.atc' is not available.uuinvalid job id '{0}'uerrorN(RRR(RR(tjobidR,((s3/usr/lib/python2.7/site-packages/salt/modules/at.pytatc
scK@srg}|jdd�}|jdd�}|jdd�}|jdd�}|jdd�}|jdd�}|jdd�}|r�ttj|��dkr�d	j|�}nt�d
}	|	s�i|d
6Sxq|	D]i}
|s�n||
dkr�nq�|s
n||
dkr�nq�|s)n2djt|��|
d
jd�dkr�nq�|sdn2djt|��|
d
jd�dkr�nq�|s�n2djt|��|
djd�dkr�nq�|s�n2djt|��|
djd�dkr�nq�|sn#||
djd�dkr�nq�|j	|
�q�W|sgd}i|d
6|d6Si|d
6S(u 
    Return match jobs list
    urunasutaguhouruminuteudayumonthuyeariu20{0}ujobsuuseru{0:02d}utimeu:iiudateu-u"No match jobs or time format errorunoteN(
tgetRR9RR(RR6R)RR$(RAR+trunasR*thourtminutetdaytmonthtyeartjobinfoR0tnote((s3/usr/lib/python2.7/site-packages/salt/modules/at.pyt_atq"sl!

,,,,cK@s|sidd6St|�S(u%
    Check the job from queue.
    The kwargs dict include 'hour minute day month year tag runas'
    Other parameters will be ignored.

    CLI Example:

    .. code-block:: bash

        salt '*' at.jobcheck runas=jam day=13
        salt '*' at.jobcheck day=13 month=12 year=13 tag=rose
    uYou have given a conditionuerror(RP(RA((s3/usr/lib/python2.7/site-packages/salt/modules/at.pytjobcheckss(uOpenBSDuFreeBSD(t__doc__t
__future__RRRRR!R tsalt.ext.six.movesRtsalt.exceptionsRtsalt.extRtsalt.utils.dataRtsalt.utils.pathtsalt.utils.platformR'RRRRR6R?RDRFRPRQ(((s3/usr/lib/python2.7/site-packages/salt/modules/at.pyt<module>s(		g	,	8		Q

Zerion Mini Shell 1.0