HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/__pycache__/splay.cpython-310.pyc
o

�N�gj	�@sVdZddlZddlZddlZe�e�ZdZdZ	da
dd�Zdd�Zd	d
�Z
dd�ZdS)
z.
Splay function calls across targeted minions
�Ni,i cCs
t�adS�N)�	_get_hash�	_HASH_VAL)�opts�r�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/splay.py�__init__s
rcCs�d}d}ttjj�td��D]}|||@}||d>|@}||d?A|@}q||d>|@}||d?A|@}||d>|@}|td	@|@S)
z}
    Jenkins One-At-A-Time Hash Function
    More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time
    l��r�id�
�����)�	bytearray�salt�utilsZstringutils�to_bytesZ
__grains__�
_HASH_SIZE)Zbitmask�h�irrrrsrcCst|ttt��Sr)�intr�floatr)�	splaytimerrr�_calc_splay+srcCsld|vrd|dvr|dd}n|�dt�}|dkrtd��|�d�}t|�}t�d||�t�|�dS)a�
    Splay a salt function call execution time across minions over
    a number of seconds (default: 300)

    .. note::
        You *probably* want to use --async here and look up the job results later.
        If you're dead set on getting the output from the CLI command, then make
        sure to set the timeout (with the -t flag) to something greater than the
        splaytime (max splaytime + time to execute job).
        Otherwise, it's very likely that the cli will time out before the job returns.

    CLI Example:

    .. code-block:: bash

        # With default splaytime
        salt --async --module-executors='[splay, direct_call]' '*' pkg.install cowsay version=3.03-8.el6

    .. code-block:: bash

        # With specified splaytime (5 minutes) and timeout with 10 second buffer
        salt -t 310 --module-executors='[splay, direct_call]' --executor-opts='{splaytime: 300}' '*' pkg.version cowsay
    Z
executor_optsrrz$splaytime must be a positive integerZfunzSplay is sleeping %s secs on %sN)�get�_DEFAULT_SPLAYTIME�
ValueErrorr�log�debug�time�sleep)r�data�func�args�kwargsrZfun_nameZmy_delayrrr�execute/s

r&)�__doc__�loggingr Zsalt.utils.stringutilsr�	getLogger�__name__rrrrrrrr&rrrr�<module>s