B
    `                 @   sr   d dl mZmZmZ eZdZyd dlZW n e	k
rD   d dlZY nX d dl
mZ d dlmZ G dd deZdS )    )absolute_importdivisionprint_functiona  
    name: pickle
    short_description: Pickle formatted files.
    description:
        - This cache uses Python's pickle serialization format, in 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
N)PY3)BaseFileCacheModulec               @   s    e Zd ZdZdd Zdd ZdS )CacheModulez2
    A caching module backed by pickle files.
    c          	   C   s6   t |d"}trtj|ddS t|S W d Q R X d S )Nrbbytes)encoding)openr   pickleload)selffilepathf r   i/home/dcms/DCMS/lib/python3.7/site-packages/ansible_collections/community/general/plugins/cache/pickle.py_load8   s    zCacheModule._loadc          	   C   s*   t |d}tj||dd W d Q R X d S )Nwb   )protocol)r   r   dump)r   valuer   r   r   r   r   _dump@   s    zCacheModule._dumpN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   3   s   r   )
__future__r   r   r   type__metaclass__ZDOCUMENTATIONcPickler   ImportErrorZansible.module_utils.sixr   Zansible.plugins.cacher   r   r   r   r   r   <module>   s   !