B
    `|                 @   sd   d dl mZmZmZ eZdZd dlZd dlZd dl	m
Z
 d dlmZ d dlmZ G dd deZdS )	    )absolute_importdivisionprint_functiona  
    name: yaml
    short_description: YAML formatted files.
    description:
        - This cache uses YAML formatted, per host, files saved to the filesystem.
    author: Brian Coca (@bcoca)
    options:
      _uri:
        required: True
        description:
          - Path in which the cache plugin will save the files
        env:
          - name: ANSIBLE_CACHE_PLUGIN_CONNECTION
        ini:
          - key: fact_caching_connection
            section: defaults
      _prefix:
        description: User defined prefix to use when creating the files
        env:
          - name: ANSIBLE_CACHE_PLUGIN_PREFIX
        ini:
          - key: fact_caching_prefix
            section: defaults
      _timeout:
        default: 86400
        description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
        env:
          - name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
        ini:
          - key: fact_caching_timeout
            section: defaults
        type: integer
N)AnsibleLoader)AnsibleDumper)BaseFileCacheModulec               @   s    e Zd ZdZdd Zdd ZdS )CacheModulez0
    A caching module backed by yaml files.
    c          	   C   s(   t j|ddd}t| S Q R X d S )Nrzutf-8)encoding)codecsopenr   Zget_single_data)selffilepathf r   g/home/dcms/DCMS/lib/python3.7/site-packages/ansible_collections/community/general/plugins/cache/yaml.py_load:   s    zCacheModule._loadc          	   C   s2   t j|ddd}tj||tdd W d Q R X d S )Nwzutf-8)r
   F)ZDumperZdefault_flow_style)r   r   yamldumpr   )r   valuer   r   r   r   r   _dump>   s    zCacheModule._dumpN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   5   s   r   )
__future__r   r   r   type__metaclass__ZDOCUMENTATIONr   r   Zansible.parsing.yaml.loaderr   Zansible.parsing.yaml.dumperr   Zansible.plugins.cacher   r   r   r   r   r   <module>   s   "