
    Vhm                    V    d dl mZ dZd dlZd dlZd dlmZmZ d dlm	Z	  G d de	      Z
y)    )annotationsa	  
    name: jsonfile
    short_description: JSON formatted files.
    description:
        - This cache uses JSON formatted, per host, files saved to the filesystem.
    version_added: "1.9"
    author: Ansible Core (@ansible-core)
    options:
      _uri:
        required: True
        description:
          - Path in which the cache plugin will save the JSON files
        env:
          - name: ANSIBLE_CACHE_PLUGIN_CONNECTION
        ini:
          - key: fact_caching_connection
            section: defaults
        type: path
      _prefix:
        description: User defined prefix to use when creating the JSON files
        env:
          - name: ANSIBLE_CACHE_PLUGIN_PREFIX
        ini:
          - key: fact_caching_prefix
            section: defaults
      _timeout:
        default: 86400
        description: Expiration timeout for the cache plugin data
        env:
          - name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
        ini:
          - key: fact_caching_timeout
            section: defaults
        type: integer
N)AnsibleJSONEncoderAnsibleJSONDecoder)BaseFileCacheModulec                      e Zd ZdZd Zd Zy)CacheModulez0
    A caching module backed by json files.
    c                    t        j                  |dd      5 }t        j                  |t              cd d d        S # 1 sw Y   y xY w)Nrutf-8encoding)cls)codecsopenjsonloadr   )selffilepathfs      N/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/cache/jsonfile.py_loadzCacheModule._load7   s8    [[39 	8Q99Q$67	8 	8 	8s	   >Ac           	         t        j                  |dd      5 }|j                  t        j                  |t
        dd             d d d        y # 1 sw Y   y xY w)Nwr   r   T   )r   	sort_keysindent)r   r   writer   dumpsr   )r   valuer   r   s       r   _dumpzCacheModule._dump<   sJ    [[39 	YQGGDJJu*<UVWX	Y 	Y 	Ys   -AAN)__name__
__module____qualname____doc__r   r         r   r   r   2   s    8
Yr&   r   )
__future__r   DOCUMENTATIONr   r   ansible.parsing.ajsonr   r   ansible.plugins.cacher   r   r%   r&   r   <module>r+      s/   
 #"H   H 5Y% Yr&   