HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/ansible/plugins/callback/__pycache__/tree.cpython-39.pyc
a

�)g��@spddlmZmZmZeZdZddlZddlm	Z	ddl
mZmZddl
mZddlmZmZGdd	�d	e�ZdS)
�)�absolute_import�division�print_functionaB
    name: tree
    type: notification
    requirements:
      - invoked in the command line
    short_description: Save host events to files
    version_added: "2.0"
    options:
        directory:
            version_added: '2.11'
            description: directory that will contain the per host JSON files. Also set by the C(--tree) option when using adhoc.
            ini:
                - section: callback_tree
                  key: directory
            env:
                - name: ANSIBLE_CALLBACK_TREE_DIR
            default: "~/.ansible/tree"
            type: path
    description:
        - "This callback is used by the Ansible (adhoc) command line option C(-t|--tree)."
        - This produces a JSON dump of events in a directory, a file for each host, the directory used MUST be passed as a command line option.
N)�TREE_DIR)�to_bytes�to_text)�CallbackBase)�
makedirs_safe�unfrackpathcs\eZdZdZdZdZdZdZd�fdd�	Zd	d
�Z	dd�Z
d
d�Zddd�Zdd�Z
�ZS)�CallbackModulez]
    This callback puts results into a host specific file in a directory in json format.
    g@Z	aggregate�treeTNcs6tt|�j|||d�tr&tt�|_n|�d�|_dS)z override to set self.tree )�	task_keys�var_options�directZ	directoryN)�superr�set_optionsrr
rZ
get_option)�selfr
rr��	__class__��A/usr/lib/python3.9/site-packages/ansible/plugins/callback/tree.pyr1szCallbackModule.set_optionsc
Cs�t|�}zt|j�WnFttfy\}z*|j�dt|j�t|�f�WYd}~n
d}~00zLttj	�
|j|��}t|d��}|�|�Wd�n1s�0YWn@ttfy�}z$|j�d|t|�f�WYd}~n
d}~00dS)z' write something into treedir/hostname z<Unable to access or create the configured directory (%s): %sNzwb+z Unable to write to %s's file: %s)
rr	r�OSError�IOErrorZ_displayZwarningr�os�path�join�open�write)r�hostname�buf�er�fdrrr�write_tree_file<s4,zCallbackModule.write_tree_filecCs|�|j��|�|j��dS�N)r"Z_hostZget_nameZ
_dump_resultsZ_result�r�resultrrr�result_to_treeLszCallbackModule.result_to_treecCs|�|�dSr#�r&r$rrr�v2_runner_on_okOszCallbackModule.v2_runner_on_okFcCs|�|�dSr#r')rr%�
ignore_errorsrrr�v2_runner_on_failedRsz"CallbackModule.v2_runner_on_failedcCs|�|�dSr#r'r$rrr�v2_runner_on_unreachableUsz'CallbackModule.v2_runner_on_unreachable)NNN)F)�__name__�
__module__�__qualname__�__doc__ZCALLBACK_VERSIONZ
CALLBACK_TYPEZ
CALLBACK_NAMEZCALLBACK_NEEDS_ENABLEDrr"r&r(r*r+�
__classcell__rrrrr's
r)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONrZansible.constantsrZansible.module_utils._textrrZansible.plugins.callbackrZansible.utils.pathr	r
rrrrr�<module>s