%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/celery.pyo

�
���^c@@s�dZddlmZmZmZddlZddlmZeje	�Z
y*ddlmZddl
mZeZWnek
r�eZnXd�Zddddededeedd	�ZdS(
u�
Support for scheduling celery tasks. The worker is independent of salt and thus can run in a different
virtualenv or on a different python version, as long as broker, backend and serializer configurations match.
Also note that celery and packages required by the celery broker, e.g. redis must be installed to load
the salt celery execution module.

.. note::
    A new app (and thus new connections) is created for each task execution
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationError(tCelery(tTimeoutErrorcC@ststdfStS(u.
    Only load if celery libraries exist.
    u?The celery module could not be loaded: celery library not found(t
HAS_CELERYtFalsetTrue(((s7/usr/lib/python2.7/site-packages/salt/modules/celery.pyt__virtual__s
g�?cC@s�|std��ntd|d|dt���}|rL|jj|�n|j���|pbg}|pni}|j|d|d|�}
|r�y&|
jd|d|d	|d
|	�SWq�tk
r�}t	j
d�|
r�|�ntSXnWdQXWdQXdS(
u�
    Execute celery tasks. For celery specific parameters see celery documentation.


    CLI Example:

    .. code-block:: bash

        salt '*' celery.run_task tasks.sleep args=[4] broker=redis://localhost \
        backend=redis://localhost wait_for_result=true

    task_name
        The task name, e.g. tasks.sleep

    args
        Task arguments as a list

    kwargs
        Task keyword arguments

    broker
        Broker for celeryapp, see celery documentation

    backend
        Result backend for celeryapp, see celery documentation

    wait_for_result
        Wait until task result is read from result backend and return result, Default: False

    timeout
        Timeout waiting for result from celery, see celery AsyncResult.get documentation

    propagate
        Propagate exceptions from celery task, see celery AsyncResult.get documentation, Default: True

    interval
        Interval to check for task result, see celery AsyncResult.get documentation, Default: 0.5

    no_ack
        see celery AsyncResult.get documentation. Default: True

    raise_timeout
        Raise timeout exception if waiting for task result times out. Default: False

    config
        Config dict for celery app, See celery documentation

    ubroker parameter is requiredtbrokertbackendtset_as_currenttargstkwargsttimeoutt	propagatetintervaltno_acku<Waiting for the result of a celery task execution timed out.N(RRRtconftupdatet
connectiont	send_tasktgetRtlogterror(t	task_nameR
RR
Rtwait_for_resultRRRRt
raise_timeouttconfigtapptasync_resulttex((s7/usr/lib/python2.7/site-packages/salt/modules/celery.pytrun_task(s$2

	(t__doc__t
__future__RRRtloggingtsalt.exceptionsRt	getLoggert__name__RtceleryRtcelery.exceptionsRRRtImportErrorRR	tNoneR!(((s7/usr/lib/python2.7/site-packages/salt/modules/celery.pyt<module>
s


		

Zerion Mini Shell 1.0