File: //lib/python3.9/site-packages/ansible/plugins/cache/__pycache__/jsonfile.cpython-39.pyc
a
�)g� � @ s\ d dl mZmZmZ eZdZd dlZd dlZd dl m
Z
mZ d dlm
Z
G dd� de
�ZdS )� )�absolute_import�division�print_functiona
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 @ s e Zd ZdZdd� Zdd� ZdS )�CacheModulez0
A caching module backed by json files.
c C sB t j|ddd��}tj|td�W d � S 1 s40 Y d S )N�r�utf-8��encoding)�cls)�codecs�open�json�loadr )�self�filepath�f� r �B/usr/lib/python3.9/site-packages/ansible/plugins/cache/jsonfile.py�_load9 s zCacheModule._loadc C sL t j|ddd��(}|�tj|tddd�� W d � n1 s>0 Y d S )N�wr
r T� )r
Z sort_keys�indent)r r �writer �dumpsr )r �valuer r r r r �_dump>