%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/chronos_job.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	Z
dgZeje
�Zd�Zd�ZdS(u�
Configure Chronos jobs via a salt proxy.

.. code-block:: yaml

    my_job:
      chronos_job.config:
        - config:
            schedule: "R//PT2S"
            command: "echo 'hi'"
            owner: "me@example.com"

.. versionadded:: 2015.8.2
i(tabsolute_importtprint_functiontunicode_literalsN(tsixuchronosc

C@sSi|d6id6td6dd6}d}td|�rOtd|�d}n|r�tj|�}tjjj|||d�n"i|d	6dd
6|dd<|}|dr�d|dkr�t	|d�dkr�d	|ddkr�d
|ddkr�|ddd	}t
jd
|�|ddd
}t
jd|�|r|r|jd�}t
jd|�|jd�}t
jd|�t	|�dkr|t	|�dkr|t
jdt
j|d�t
j|d�k�t
jdt
j|d�t
j|d�k�t
j|d�t
j|d�kryt
j|d�t
j|d�kryt
jd�i|d<qyq|qq�q�nt
jd�|dr2tdr�d|d<dj|�|d<|Std||�}	d|	krt|d<dj||	d�|d<|St|d<dj|�|d<|Snt|d<dj|�|d<|S( u
    Ensure that the chronos job with the given name is present and is configured
    to match the given config values.

    :param name: The job name
    :param config: The configuration to apply (dict)
    :return: A standard Salt changes dictionary
    unameuchangesuresultuucommentuchronos.has_jobuchronos.jobujobunewuolduscheduleiunew schedule: %suold schedule: %su/u_new schedule: %su_old schedule: %siu_new[0] == _old[0]: %siu_new[2] == _old[2]: %siu$schedules match--no need for changesutestu$Chronos job {0} is set to be updateduchronos.update_jobu	exceptionu(Failed to update job config for {0}: {1}uUpdated job config for {0}u$Chronos job {0} configured correctlyN(tFalsetNonet__salt__tcopytdeepcopytsalttutilstconfigcomparertcompare_and_update_configtlentlogtdebugtsplitRt	text_typet__opts__tformattTrue(
tnametconfigtrettexisting_configt
update_configtnewtoldt_newt_oldt
update_result((s;/usr/lib/python2.7/site-packages/salt/states/chronos_job.pyRsv


&($	'	'&&








cC@s�i|d6id6td6dd6}td|�sSt|d<dj|�|d<|Stdr~d|d<d	j|�|d<|Std
|�r�i|d6|d<t|d<dj|�|d<|St|d<d
j|�|d<|SdS(u�
    Ensure that the chronos job with the given name is not present.

    :param name: The app name
    :return: A standard Salt changes dictionary
    unameuchangesuresultuucommentuchronos.has_jobuJob {0} already absentutestuJob {0} is set to be removeduchronos.rm_jobujobuRemoved job {0}uFailed to remove job {0}N(RRRRRR(RR((s;/usr/lib/python2.7/site-packages/salt/states/chronos_job.pytabsentts(






(t__doc__t
__future__RRRRtloggingtsalt.extRtsalt.utils.configcomparerR	t__proxyenabled__t	getLoggert__file__RRR(((s;/usr/lib/python2.7/site-packages/salt/states/chronos_job.pyt<module>s		Y

Zerion Mini Shell 1.0