File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/__pycache__/transactional_update.cpython-310.pyc
Back
o ;j� � @ sB d Z ddlZddlZddddd�Zg d�Zg Zd d � Zdd� ZdS ) z8 Transactional executor module .. versionadded:: 3004 � Nztransactional_update.singleztransactional_update.slsztransactional_update.applyztransactional_update.highstate)zstate.singlez state.slszstate.applyzstate.highstate)ZansibleZcabalZchef�cmdZcomposerZcpZcpanZcyg�fileZfreezeZnixZnpmZpipZpkgZpuppetZpyenvZrbenvZscpc C s t jj�d�r dS dS )Nztransactional-updateT)Fz=transactional_update executor requires a transactional system)�salt�utils�path�which� r r �W/opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/transactional_update.py�__virtual__/ s r c C s t j�d�}|d }|�d�\}}t| �dt��} t| �dt��} d|v r>| t|d �dg ��O } | t|d �dg ��O } n| t| �dg ��O } | t| �dg ��O } |tv rh|shtd | |t t| ||�}|S || v sp|| v r�|s�t d |g|�R i |��}|S td | ||||�}|S )a� Delegate into transactional_update module The ``transactional_update`` module support the execution of functions inside a transaction, as support apply a state (via ``apply``, ``sls``, ``single`` or ``highstate``). This execution module can be used to route some Salt modules and functions to be executed inside the transaction snapshot. Add this executor in the minion configuration file: .. code-block:: yaml module_executors: - transactional_update - direct_call Or use the command line parameter: .. code-block:: bash salt-call --module-executors='[transactional_update, direct_call]' test.version You can also schedule a reboot if needed: .. code-block:: bash salt-call --module-executors='[transactional_update]' state.sls stuff activate_transaction=True There are some configuration parameters supported: .. code-block:: yaml # Replace the list of default modules that all the functions # are delegated to `transactional_update.call()` delegated_modules: [cmd, pkg] # Replace the list of default functions that are delegated to # `transactional_update.call()` delegated_functions: [pip.install] # Expand the default list of modules add_delegated_modules: [ansible] # Expand the default list of functions add_delegated_functions: [file.copy] ZTRANSACTIONAL_UPDATE�fun�.�delegated_modules�delegated_functionsZ executor_optsZadd_delegated_modulesZadd_delegated_functionszdirect_call.executeztransactional_update.call) �os�environ�get�split�set�DEFAULT_DELEGATED_MODULES�DEFAULT_DELEGATED_FUNCTIONS�DELEGATION_MAPZ __executors__Z__salt__)�opts�data�func�args�kwargsZinside_transactionr �module�_r r �resultr r r �execute6 s4 1 ��� ���r ) �__doc__r Zsalt.utils.pathr r r r r r r r r r �<module> s �
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings