403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/__pycache__/file.cpython-310.pyc
o

;j��@s2dZddlZddlZddlZddlZddd�ZdS)a�
Writes matches to disk to verify activity, helpful when testing

Normally this is used by giving the name of the file (without a path) that the
data will be saved to. If for instance you use ``foo`` as the name:

.. code-block:: yaml

    foo:
      file.save

Then the file will be saved to:

.. code-block:: bash

    <salt cachedir>/thorium/saves/foo

You may also provide an absolute path for the file to be saved to:

.. code-block:: yaml

    /tmp/foo.save:
        file.save

Files will be saved in JSON format. However, JSON does not support ``set()``s.
If you are saving a register entry that contains a ``set()``, then it will fail
to save to JSON format. However, you may pass data through a filter which makes
it JSON compliant:

.. code-block:: yaml

    foo:
      file.save:
        filter: True

Be warned that if you do this, then the file will be saved, but not in a format
that can be re-imported into Python.
�NFcCs�|iddd�}|�d�rtj�|�}|}ntj�tddd�}tj�||�}tj�|�s1t�|�tj	j
�|d��+}|durLtj	j�
tj	j�t�|�ntj	j�
t|�Wd	�|SWd	�|S1sgwY|S)
aB
    Save the register to <salt cachedir>/thorium/saves/<name>, or to an
    absolute path.

    If an absolute path is specified, then the directory will be created
    non-recursively if it doesn't exist.

    USAGE:

    .. code-block:: yaml

        foo:
          file.save

        /tmp/foo:
          file.save
    �T)�nameZchangesZcomment�result�/ZcachedirZthoriumZsaveszw+N)�
startswith�os�path�dirname�joinZ__opts__�isdir�makedirs�salt�utils�filesZfopen�json�dump�dataZsimple_types_filterZ__reg__)r�filter�retZtgt_dirZfn_Zfp_�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/file.py�save/s&


��
��r)F)�__doc__rZsalt.utils.datar
Zsalt.utils.filesZsalt.utils.jsonrrrrr�<module>s'

Youez - 2016 - github.com/yon3zu
LinuXploit