%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/thorium/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/thorium/file.pyo |
�
���^c @@ sb d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z e
d � Z d S( u�
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.
i ( t absolute_importt print_functiont unicode_literalsNc C@ s i | d 6i d 6d d 6t d 6} | j d � rL t j j | � } | } n1 t j j t d d d � } t j j | | � } t j j | � s� t j | � n t j
j j | d
� �Q } | t k r� t j
j
j t j
j j t � | � n t j
j
j t | � Wd QX| S( uB
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
u nameu changesu u commentu resultu /u cachediru thoriumu savesu w+N( t Truet
startswitht ost patht dirnamet joint __opts__t isdirt makedirst saltt utilst filest fopent jsont dumpt datat simple_types_filtert __reg__( t namet filtert rett tgt_dirt fn_t fp_( ( s5 /usr/lib/python2.7/site-packages/salt/thorium/file.pyt save3 s
(( t __doc__t
__future__R R R R t salt.utils.dataR t salt.utils.filest salt.utils.jsont FalseR ( ( ( s5 /usr/lib/python2.7/site-packages/salt/thorium/file.pyt <module>'