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/wheel/__pycache__/config.cpython-310.pyc
o

�N�g��@sZdZddlZddlZddlZddlZddlZddlZe�e	�Z
dd�Zdd�Zdd�Z
dS)	z&
Manage the master configuration file
�NcCstj�td�}|S)z2
    Return the raw values of the config file
    �	conf_file)�saltZconfigZ
master_config�__opts__)�data�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/wheel/config.py�valuessrcCsxtd}tj�|�rtj�|d�}t�}|||<tjj�	|d��}tjj
j|dd�Wd�dS1s5wYdS)za
    Set a single key

    .. note::

        This will strip comments from your config file
    rZmasterzw+F�Zdefault_flow_styleN)r�os�path�isdir�joinrr�utils�files�fopen�yaml�	safe_dump)�key�valuerr�fp_rrr�applys"�rc
Csd�|d�}tj�tdtj�td��}zPtjjj	|dd�}tj�
|�s1t�d|�t�
|d�tj�||�}tjj�||�sCWd	Stjj�|d
��
}|�|�Wd�n1s[wYd|��WSttjjjtfy�}z
t|�WYd}~Sd}~ww)
a{
    Update master config with
    ``yaml_contents``.

    Writes ``yaml_contents`` to a file named
    ``file_name.conf`` under the folder
    specified by ``default_include``.
    This folder is named ``master.d`` by
    default. Please look at
    :conf_master:`include-configuration`
    for more information.

    Example low data:

    .. code-block:: python

        data = {
            'username': 'salt',
            'password': 'salt',
            'fun': 'config.update_config',
            'file_name': 'gui',
            'yaml_contents': {'id': 1},
            'client': 'wheel',
            'eauth': 'pam',
        }
    z{}{}z.confZ
config_dirZdefault_includeFr	zCreating directory %si�zInvalid path�wNzWrote )�formatr
rr
r�dirnamerrrr�exists�log�debug�makedirsZverifyZ
clean_pathrr�write�OSErrorZ	YAMLError�
ValueError�str)�	file_nameZ
yaml_contentsZdir_pathZyaml_outZ	file_pathr�errrrr�
update_config)s.�����r$)�__doc__�loggingr
Zsalt.configrZsalt.utils.filesZsalt.utils.verifyZsalt.utils.yaml�	getLogger�__name__rrrr$rrrr�<module>s