
    Vh                         d Z ddlmZmZmZ eZddlmZm	Z	 ddl
mZ ddlmZ ddlmZ ddlmZ ddlmZ i Z G d	 d
e      Zy)z%
The action plugin file for validate
    )absolute_importdivisionprint_function)AnsibleActionFailAnsibleError)to_text)
ActionBase)check_argspec)DOCUMENTATION)_load_validatorc                   8     e Zd ZdZdZdZ fdZd ZddZ xZ	S )ActionModulezaction moduleValidateFc                 H    t        t        | 
  |i | d | _        i | _        y )N)superr   __init___validator_name_result)selfargskwargs	__class__s      i/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ansible/utils/plugins/action/validate.pyr   zActionModule.__init__"   s&    lD*D;F;#    c                 v    dj                  | j                  ||      }| j                  j                  |       y)zdOutput text using ansible's display

        :param msg: The message
        :type msg: str
        z<{phost}> {name} {msg})phostnamemsgN)format	_playhost_displayvvvv)r   r   r   s      r   _debugzActionModule._debug'   s2     '--DNNSV-W3r   c           
         t        t        dfdt        i| j                  j                  \  }}}|s|S || _        |r|j                  d      nd| _        t        |d   |d   |d   |      \  | _	        }|j                  d	      r|S 	 | j                  j                         }d| j                   d<   |j                  d      rX|d   | j                   d<   | j                   j#                  d	di       d|v rd|d   z   | j                   d<   nd| j                   d<   |j                  dg       r0|d   | j                   d<   | j                   d   sd| j                   d<   | j                   d   sd| j                   d<   | j                   S # t        $ r}t        t        |d
            d}~wt        $ r6}t        dj                  | j                  t        |d
                  d}~ww xY w)a  The std execution entry pt for an action plugin

        :param tmp: no longer used
        :type tmp: none
        :param task_vars: The vars provided when the task is run
        :type task_vars: dict
        :return: The results from the parser
        :rtype: dict
        zvalidate moduleschema_conditionalsinventory_hostnameNenginedatacriteria)r'   r(   r)   plugin_varsfailedsurrogate_then_replace)errorsz>Unhandled exception from validator '{validator}'. Error: {err})	validatorerr r   r-   TzValidation errors were found.
zValidation errors were found.warningsz'Non-fatal validation errors were found.zAll checks passed.)r
   r   ARGSPEC_CONDITIONALS_taskr   
_task_varsgetr    r   _validator_enginevalidater   r   r   	Exceptionr   r   update)	r   tmp	task_varsvalidargspec_resultupdated_paramsvalidator_resultresultexcs	            r   runzActionModule.run0   s    1>1
 !51
 jjoo	1
-~~ !!#@I';<t3B!(+'#J/!	4
0 0 )##
	++446F !U::h%+H%5DLL"LL4 01&G&QV-&WU#&EU#::j"%'-j'9DLL$<<&&OU#||E""6DLL||7  	S#GC8P$QRR 	#PWW"44,DE X  	s$   	F 	G(F&&G(21G##G()NN)
__name__
__module____qualname____doc__VALIDATE_CLS_NAME_requires_connectionr   r#   rB   __classcell__)r   s   @r   r   r      s!    " 
 <r   r   N)rF   
__future__r   r   r   type__metaclass__ansible.errorsr   r   ansible.module_utils._textr   ansible.plugins.actionr	   Nansible_collections.ansible.utils.plugins.module_utils.common.argspec_validater
   :ansible_collections.ansible.utils.plugins.modules.validater   Dansible_collections.ansible.utils.plugins.plugin_utils.base.validater   r2   r    r   r   <module>rT      sG    A @  : . - U `  P: Pr   