%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/runners/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/runners/state.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlmZej
e�Zddd�Zejjjed�Zdd�Zejjjed�Zdd	�Zd
ddddddd�Zejjjed�Zejjjed
�Zdedd�Zdedd�Zd
dedddd�Zejjjed�Z ddededd�Z!dS(u!
Execute orchestration functions
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrorcC@s-tjjt�}|jd|||�dS(u�
    Set up a state id pause, this instructs a running state to pause at a given
    state id. This needs to pass in the jid of the running state and can
    optionally pass in a duration in seconds.
    ustate.pauseN(tsalttminiontMasterMiniont__opts__t	functions(tjidtstate_idtdurationR((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytpausesu	set_pausecC@s*tjjt�}|jd||�dS(u<
    Remove a pause from a jid, allowing it to continue
    ustate.resumeN(RRRRR(R	R
R((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytresume surm_pausecC@s*tjjt�}|jd||�dS(uA
    Set up a state run to die before executing the given state id,
    this instructs a running state to safely exit at a given
    state id. This needs to pass in the jid of the running state.
    If a state_id is not passed then the jid referenced will be safely exited
    at the beginning of the next state run.
    ustate.soft_killN(RRRRR(R	R
R((s6/usr/lib/python2.7/site-packages/salt/runners/state.pyt	soft_kill+subasecC@sI|dk	r+t|t�r+td��ndtd<tjjt�}|dkrldtkrltd}n|dkr�dtkr�td}n|dkr�tjj	j
t�}n|jd|||d|d|d	|d
|d|d|�}	ii|	|jd
6d6dd6}
t
d|
d�}|r;d|
d<n
d|
d<|
S(u}
    .. versionadded:: 0.17.0

    Execute a state run from the master, used as a powerful orchestration
    system.

    .. seealso:: More Orchestrate documentation

        * :ref:`Full Orchestrate Tutorial <orchestrate-runner>`
        * :py:mod:`Docs for the master-side state module <salt.states.saltmod>`

    CLI Examples:

    .. code-block:: bash

        salt-run state.orchestrate webserver
        salt-run state.orchestrate webserver saltenv=dev test=True
        salt-run state.orchestrate webserver saltenv=dev pillarenv=aws

    .. versionchanged:: 2014.1.1

        Runner renamed from ``state.sls`` to ``state.orchestrate``

    .. versionchanged:: 2014.7.0

        Runner uses the pillar variable

    .. versionchanged:: develop

        Runner uses the pillar_enc variable that allows renderers to render the pillar.
        This is usable when supplying the contents of a file as pillar, and the file contains
        gpg-encrypted entries.

    .. seealso:: GPG renderer documentation

    CLI Examples:

    .. code-block:: bash

       salt-run state.orchestrate webserver pillar_enc=gpg pillar="$(cat somefile.json)"

    u-Pillar data must be formatted as a dictionaryulocalufile_clientu	pillarenvusaltenvu	state.slstpillartsaltenvt	pillarenvt
pillar_enct	__pub_jidtorchestration_jiduidudatau	highstateu	outputterustate.check_resultiuretcodeiN(tNonet
isinstancetdictRRRRRtutilsR	tgen_jidRtoptst	__utils__(tmodsRttesttexcludeRRRRRtrunningtrettres((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytorchestrate7s62



	"

uorchuslsc	K@s�|d
k	r+t|t�r+td��ndtd<tjjt�}|jd||dd
dt	d||�}i||j
d6}tji|d	6d
d6d�|S(u�
    Execute a single state orchestration routine

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt-run state.orchestrate_single fun=salt.wheel name=key.list_all
    u-Pillar data must be formatted as a dictionaryulocalufile_clientustate.singleRtqueueRuidudatau	highstateu	outputteruprogressN(
RRRRRRRRRtFalseRt
__jid_event__t
fire_event(	tfuntnameRR#RtkwargsRRR ((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytorchestrate_single�s

	c
K@s�|d
k	r+t|t�r+td��ndtd<tjjt�}|jd|dd
dt	d||�}i||j
d6}tji|d	6d
d6d�|S(u�
    Execute a single state orchestration routine

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt-run state.orchestrate_high '{
            stage_one:
                {salt.state: [{tgt: "db*"}, {sls: postgres_setup}]},
            stage_two:
                {salt.state: [{tgt: "web*"}, {sls: apache_setup}, {
                    require: [{salt: stage_one}],
                }]},
            }'
    u-Pillar data must be formatted as a dictionaryulocalufile_clientu
state.highRR#Ruidudatau	highstateu	outputteruprogressN(
RRRRRRRRRR$RR%R&(tdataRR#RR)RRR ((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytorchestrate_high�s

	c

C@s�|d
k	r+t|t�r+td��ndtd<tjjt�}|jd|||d|d|d|d|�}i||j	d	6}	|	S(u�
    Display the state data from a specific sls, or list of sls files, after
    being render using the master minion.

    Note, the master minion adds a "_master" suffix to it's minion id.

    .. seealso:: The state.show_sls module function

    CLI Example:
    .. code-block:: bash

        salt-run state.orch_show_sls my-orch-formula.my-orch-state 'pillar={ nodegroup: ng1 }'
    u-Pillar data must be formatted as a dictionaryulocalufile_clientustate.show_slsRRRRuidN(
RRRRRRRRRR(
RRRR#RRRRRR ((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytorchestrate_show_sls�s

	u
orch_show_slsu*i����umasterc
C@sGtjjtdd	�}|dd|d|d|d|d|d|�S(
uS
    Watch Salt's event bus and block until the given tag is matched

    .. versionadded:: 2014.7.0
    .. versionchanged:: 2019.2.0
        ``tagmatch`` can now be either a glob or regular expression.

    This is useful for utilizing Salt's event bus from shell scripts or for
    taking simple actions directly from the CLI.

    Enable debug logging to see ignored events.

    :param tagmatch: the event is written to stdout for each tag that matches
        this glob or regular expression.
    :param count: this number is decremented for each event that matches the
        ``tagmatch`` parameter; pass ``-1`` to listen forever.
    :param quiet: do not print to stdout; just block
    :param sock_dir: path to the Salt master's event socket file.
    :param pretty: Output the JSON all on a single line if ``False`` (useful
        for shell tools); pretty-print the JSON output if ``True``.
    :param node: Watch the minion-side or master-side event bus.
        .. versionadded:: 2016.3.0

    CLI Examples:

    .. code-block:: bash

        # Reboot a minion and run highstate when it comes back online
        salt 'jerry' system.reboot && \\
            salt-run state.event 'salt/minion/jerry/start' count=1 quiet=True && \\
            salt 'jerry' state.highstate

        # Reboot multiple minions and run highstate when all are back online
        salt -L 'kevin,stewart,dave' system.reboot && \\
            salt-run state.event 'salt/minion/*/start' count=3 quiet=True && \\
            salt -L 'kevin,stewart,dave' state.highstate

        # Watch the event bus forever in a shell while-loop.
        salt-run state.event | while read -r tag data; do
            echo $tag
            echo $data | jq --color-output .
        done

    .. seealso::

        See :blob:`tests/eventlisten.sh` for an example of usage within a shell
        script.
    ustateustate.eventttagmatchtcounttquiettsock_dirtprettytnodeN(Rtloadertraw_modRR(R.R/R0R1R2R3tstatemod((s6/usr/lib/python2.7/site-packages/salt/runners/state.pytevent�s6
("t__doc__t
__future__RRRtloggingtsalt.loaderRtsalt.utils.eventtsalt.utils.functoolstsalt.utils.jidtsalt.exceptionsRt	getLoggert__name__tLOGGERRRRt	functoolstalias_functiont	set_pauseR
trm_pauseRR"torchtslsR$R*R,R-t
orch_show_slsR7(((s6/usr/lib/python2.7/site-packages/salt/runners/state.pyt<module>sJ

M%!

Zerion Mini Shell 1.0