File: //lib/python3.9/site-packages/ansible/plugins/callback/__pycache__/minimal.cpython-39.pyc
a
�)g � @ sH d dl mZmZmZ eZdZd dlmZ d dl m
Z G dd� de�ZdS )� )�absolute_import�division�print_functiona
name: minimal
type: stdout
short_description: minimal Ansible screen output
version_added: historical
description:
- This is the default output callback used by the ansible command (ad-hoc)
extends_documentation_fragment:
- result_format_callback
)�CallbackBase)� constantsc @ sN e Zd ZdZdZdZdZdd� Zddd �Zd
d� Z dd
� Z
dd� Zdd� ZdS )�CallbackModulez�
This is the default callback interface, which simply prints messages
to stdout when new callback events are received.
g @�stdoutZminimalc C sN d|||� dd�f }||� dd�7 }||� dd�7 }||� dd�7 }|d S ) z$ output the result of a command run z%s | %s | rc=%s >>
�rc���r � �stderr�msg�
)�get)�self�host�resultZcaption�buf� r �D/usr/lib/python3.9/site-packages/ansible/plugins/callback/minimal.py�_command_generic_msg# s
z#CallbackModule._command_generic_msgFc C s� | � |j� | �|j� |jjtjv rVd|jvrV| jj| � |j
�� |jd�tjd� n,| jjd|j
�� | j
|jdd�f tjd� d S )NZ
module_stderrZFAILED��colorz%s | FAILED! => %s� ��indent)Z_handle_exception�_result�_handle_warnings�_task�action�C�MODULE_NO_JSON�_display�displayr �_host�get_nameZCOLOR_ERROR�
_dump_results)r r �
ignore_errorsr r r �v2_runner_on_failed- s
&z"CallbackModule.v2_runner_on_failedc C s� | � |j|jj� | �|j� |j�dd�r8tj}d}n
tj}d}|jjtj v r~d|jvr~| j
j| �|j
�� |j|�|d� n,| j
jd|j
�� || j|jdd �f |d� d S )
NZchangedFZCHANGED�SUCCESSZansible_job_idr z
%s | %s => %sr r )Z_clean_resultsr r r r r r Z
COLOR_CHANGEDZCOLOR_OKr! r"