
    Vh                       d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZmZmZ d dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d d	lm Z m!Z! d d
l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) d dl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 d dl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZB  eCd      ZDe4dede5dede6dede7dedfZEi ddddddddddddddd d!d"d#d$d%g d&fd'd(d)d*d+d,d-d.d/d0d1d2d3d4ZFd5ZGeBe?e;e9e=e<e@eAe>e>e:e8d6ZHd7 ZIdId8ZJdJd9ZKdKd:ZLdLd;ZMd< ZNd= ZOd> ZPdMd?ZQd@ ZRdKdAZSdNdBZTdKdCZU	 	 	 	 	 	 	 dOdDZVdE ZWdF ZX eY       fdGZZdH Z[y)P    )annotationsN)deque)chain)is_iterable)to_bytes	to_nativeto_text)warn)
AliasErrorAnsibleFallbackNotFoundAnsibleValidationErrorMultipleArgumentTypeErrorArgumentValueErrorElementErrorMutuallyExclusiveError
NoLogErrorRequiredByErrorRequiredErrorRequiredIfErrorRequiredOneOfErrorRequiredTogetherErrorSubParameterTypeError)BOOLEANS_FALSEBOOLEANS_TRUE)KeysViewSetSequenceMappingMutableMapping
MutableSetMutableSequence)binary_typeinteger_typesstring_types	text_typePY2PY3)check_mutually_exclusivecheck_required_argumentscheck_required_togethercheck_required_one_ofcheck_required_ifcheck_required_bycheck_type_bitscheck_type_boolcheck_type_bytescheck_type_dictcheck_type_floatcheck_type_intcheck_type_jsonargcheck_type_listcheck_type_pathcheck_type_rawcheck_type_strrequired_together)funcattrerrrequired_one_ofrequired_ifrequired_by
check_mode)r@   Fdebug)_debugFdiff)_diffFkeep_remote_files)_keep_remote_filesFignore_unknown_opts)_ignore_unknown_optsFmodule_name)_nameNno_log)rK   F
remote_tmp)_remote_tmpNtarget_log_info)_target_log_infoNselinux_special_fs_selinux_special_fs)fusenfsvboxsframfs9pvfatshell_executable)_shellz/bin/shsocket)_socket_pathNstring_conversion_action)_string_conversion_actionr
   syslog_facility)_syslog_facilityINFOtmpdir)_tmpdirN	verbosity)
_verbosityr   version)ansible_versionz0.0)r@   rA   rC   rE   rG   rK   )strlistdictboolintfloatpathrawjsonargjsonbytesbitsc           	         t        |       s| d} t        j                  |       }|| fS | }t        | dt	        t        |                   } || fS )a  Returns the callable used to validate a wanted type and the type name.

    :arg wanted: String or callable. If a string, get the corresponding
        validation function from DEFAULT_TYPE_VALIDATORS. If callable,
        get the name of the custom callable and return that for the type_checker.

    :returns: Tuple of callable function or None, and a string that is the name
        of the wanted type.
    rg   __name__)callableDEFAULT_TYPE_VALIDATORSgetgetattrr   type)wantedtype_checkers     V/home/dcms/DCMS/lib/python3.12/site-packages/ansible/module_utils/common/parameters.py_get_type_validatorr}   |   s\     F>F.226:  YtF|-DE    c                    |t        | |      }t        |j                               t        | j                               z   S N)_handle_aliasesrh   keys)argument_spec
parametersaliasess      r|   _get_legal_inputsr      s7    !-<$}'9'9';"<<<r~   c                8   |t        | |      }t               }|j                         D ]n  }||vs|}|rt        ||gz         }|j	                  |       |/t        | |      }g }	|D ]  }
|
|v r|	j                  |
        |j                  ||	|fi       p |S )a  Check keys in parameters against those provided in legal_inputs
    to ensure they contain legal values. If legal_inputs are not supplied,
    they will be generated using the argument_spec.

    :arg argument_spec: Dictionary of parameters, their type, and valid values.
    :arg parameters: Dictionary of parameters.
    :arg legal_inputs: List of valid key names property names. Overrides values
        in argument_spec.
    :arg options_context: List of parent keys for tracking the context of where
        a parameter is defined.

    :returns: Set of unsupported parameters. Empty set if no unsupported parameters
        are found.
    )r   setr   tupleaddr   appendupdate)r   r   legal_inputsoptions_contextstore_supportedunsupported_parameterskcontextsupported_aliasessupported_paramsoptions              r|   _get_unsupported_parametersr      s      (
C U__ YL G1# 56"&&w/*$3M:$N!#% * 4F!22 $++F34
  &&2BDU1V'WX!Y$ "!r~   c                   i }| j                         D ]  \  }}|j                  dd      }|j                  dd      }|j                  dd      }	|?| |   j                  dg       D ]'  }
|
j                  d      |v s|j                  |
       ) ||	rt        d|z        |t	        |      rt        |t        t        f      rt        d	      |D ]-  }
|||
<   |
|v s||v r||j                  ||
f       ||
   ||<   /  |S )
aU  Process aliases from an argument_spec including warnings and deprecations.

    Modify ``parameters`` by adding a new key for each alias with the supplied
    value from ``parameters``.

    If a list is provided to the alias_warnings parameter, it will be filled with tuples
    (option, alias) in every case where both an option and its alias are specified.

    If a list is provided to alias_deprecations, it will be populated with dictionaries,
    each containing deprecation information for each alias found in argument_spec.

    :param argument_spec: Dictionary of parameters, their type, and valid values.
    :type argument_spec: dict

    :param parameters: Dictionary of parameters.
    :type parameters: dict

    :param alias_warnings:
    :type alias_warnings: list

    :param alias_deprecations:
    :type alias_deprecations: list
    r   NdefaultrequiredFdeprecated_aliasesnamezBinternal error: required and default are mutually exclusive for %sz/internal error: aliases must be a list or tuple)	itemsrw   r   
ValueErrorr   
isinstancer"   r%   	TypeError)r   r   alias_warningsalias_deprecationsaliases_resultsr   vr   r   r   aliass              r|   r   r      s7   2 O%%' 2A%%	4(%%	4(55U+)&q)--.BBG 599V$
2&--e45 8adeeff?7#z'K;S'TMNN 	2E%&OE"
"
?~'A"))1e*5 *5 1
1	2)26 r~   c           	     d   g }| j                         D ]  \  }}||v s|r	|d|d}n|}|j                  d      7|j                  d|z  |j                  d      |j                  d      d       nG|j                  d      6|j                  d|z  |j                  d      |j                  d      d       |j                  d	      }|||   }t        |t              r|g}t        |t
              s|D ]0  }	t        |	t              s|j                  t        ||	|
             2  |S )a  Return a list of deprecations

    :arg argument_spec: An argument spec dictionary
    :arg parameters: Dictionary of parameters

    :returns: List of dictionaries containing a message and version in which
        the deprecated parameter will be removed, or an empty list.

    :Example return:

    .. code-block:: python

        [
            {
                'msg': "Param 'deptest' is deprecated. See the module docs for more information",
                'version': '2.9'
            }
        ]
    z["z"]removed_at_datezBParam '%s' is deprecated. See the module docs for more informationremoved_from_collection)msgdatecollection_nameremoved_in_version)r   re   r   options)prefix)r   rw   r   r   r   rh   extend_list_deprecations)
r   r   r   deprecationsarg_namearg_opts
sub_prefixsub_argument_specsub_arguments
sub_paramss
             r|   r   r      sJ   * L+113 v(z!+18<
%
||-.:##_bll$LL):;'/||4M'N% 
 23?##_bll'||,@A'/||4M'N%  !)Y 7 , *8 4mW5%2OMmT2&3 v
%j':(//0BCTV`is0tuv3v: r~   c           
        t               }| j                         D ]  \  }}|j                  dd      r/|j                  |d      }|r	 |j                  t	        |             |j                  d      }|\|j                  d      }|j                  |      }	|	|dk(  s|d	k(  s|j                  d
d      dk(  st        |	t              s|	g}	|	D ]d  }
t        |
t              rt        |
      }
t        |
t              st        dj                  ||
|            |j                  t        ||
             f   |S # t
        $ r}t        d|dt        |            d}~ww xY w)zReturn set of no log values

    :arg argument_spec: An argument spec dictionary
    :arg params: Dictionary of all parameters

    :returns: :class:`set` of strings that should be hidden from output:
    rK   FNzFailed to convert "z": r   ry   ri   rh   elements zXValue '{1}' in the sub parameter field '{0}' must be a {2}, not '{1.__class__.__name__}')r   r   rw   r   _return_datastructure_namer   r   r   rh   r$   r1   r   format_list_no_log_values)r   paramsno_log_valuesr   r   no_log_objecter   wanted_typesub_parameters	sub_params              r|   r   r   6  sw    EM+113 !`(<<%("JJx6M]!(()CM)RS
 %LL3(",,v.K#ZZ1N)&([F-Bx||T^`bGcgmGm%nd;*8)9%3 
`	 &i>(7	(BI))W="+ -KKQ6RZ\egrKs#u u &,,-@ART]-^_
`/!`F 7 ! ]#HiXYl$[\\]s   	D>>	E&E!!E&c              #    K   t        | t        t        f      r| rt        | d       yt        | t              r,| j                         D ]  }t        |d         E d{     yt        |       r| D ]  }t        |      E d{     y| t        | t              ryt        | t        t        t              t        gz               rt        | d       yt        dt        |       z        7 7 mw)zu Return native stringified values from datastructures.

    For use with removing sensitive values pre-jsonification.surrogate_or_stricterrorsN   
simplerepr)	nonstringzUnknown parameter type: %s)r   r%   r"   r   r   r   r   r   rj   r   rh   r#   rl   r   ry   )objelements     r|   r   r   f  s      #	;/0C(=>>	C	!yy{ 	>G1'!*===	>	S	 	;G1':::	;	
3-	CtM2eW<=	>|444S	BCC > ;s%   AC5C1 %C5C3A,C53C5c                   t        | t        t        f      r| }t        | t              rd}t        r3t	        | d      }n%t        | t              rd}t
        rt        | d      }||v ry|D ]  }|j                  |d      } r t        |t              rt        |dd	      } | S |s t        |t              rt	        |dd	      } | S |} | S t        | t              r:t        | t              r t        |              }ng }|j                  | |f       |} | S t        | t              rBt        | t              r t        |              }n
t               }|j                  | |f       |} | S t        | t              r:t        | t               r t        |              }ni }|j                  | |f       |} | S t        | t#        t%        t&        t(        t*        t,        f                  r"t/        | dd	      }||v ry|D ]  }||v s y | S t        | t0        j0                  t0        j2                  f      r| j5                         } | S t7        d
t        |       d|       )a  
    Helper function for :meth:`remove_values`.

    :arg value: The value to check for strings that need to be stripped
    :arg no_log_strings: set of strings which must be stripped out of any values
    :arg deferred_removals: List which holds information about nested
        containers that have to be iterated for removals.  It is passed into
        this function so that more entries can be added to it if value is
        a container type.  The format of each entry is a 2-tuple where the first
        element is the ``value`` parameter and the second value is a new
        container to copy the elements of ``value`` into once iterated.

    :returns: if ``value`` is a scalar, returns ``value`` with two exceptions:

        1. :class:`~datetime.datetime` objects which are changed into a string representation.
        2. objects which are in ``no_log_strings`` are replaced with a placeholder
           so that no sensitive data is leaked.

        If ``value`` is a container type, returns a new empty container.

    ``deferred_removals`` is added to as a side-effect of this function.

    .. warning:: It is up to the caller to make sure the order in which value
        is passed in is correct.  For instance, higher level containers need
        to be passed in before lower level containers. For example, given
        ``{'level1': {'level2': 'level3': [True]} }`` first pass in the
        dictionary for ``level1``, then the dict for ``level2``, and finally
        the list for ``level3``.
    Tr   r   F#VALUE_SPECIFIED_IN_NO_LOG_PARAMETERz********zutf-8surrogate_then_replace)encodingr   Value of unknown type: , )r   r%   r"   r&   r   r'   r	   replacer   r!   ry   r   r   r    r   r   r   r   r   r#   rl   rj   NoneTyper   datetimer   	isoformatr   )valueno_log_stringsdeferred_removalsnative_str_valuevalue_is_textomit_me	new_valuestringy_values           r|   _remove_values_conditionsr   }  s]   < %)[12 eY' M#+E:O#P {+!M#*59N#O ~-8% 	JG/77I	J Z(8+F,wG_`EV LU :.>	#J-H`aER LO %EN LK 
E8	$e_-#UII  %!34> L; 
E3	eZ(#UII  %!34. L+ 
E7	#e^,#UII  %!34 L 
E5}udH6M!NO	P!%'BWXN*8% 	=G-'<	= L 
EH--x}}=	>! L 4;NOOr~   c                    t               }| j                         D ]K  \  }}|j                  dd      }||vs||s"|j                  dd      r|r|j                  |       |||<   M |S )a  Set default values for parameters when no value is supplied.

    Modifies parameters directly.

    :arg argument_spec: Argument spec
    :type argument_spec: dict

    :arg parameters: Parameters to evaluate
    :type parameters: dict

    :kwarg set_default: Whether or not to set the default values
    :type set_default: bool

    :returns: Set of strings that should not be logged.
    :rtype: set
    r   NrK   F)r   r   rw   r   )r   r   set_defaultr   paramr   r   s          r|   _set_defaultsr     sz    $ EM%++- (u ))It, 
"(;{yy5)g!!'* 'Ju( r~   c                   t        | t        t        f      r| S t        | t              r8t        | t              r t        |              }ng }|j                  | |f       |S t        | t              r@t        | t              r t        |              }n
t               }|j                  | |f       |S t        | t              r8t        | t              r t        |              }ni }|j                  | |f       |S t        | t        t        t        t        t         t"        f                  r| S t        | t$        j$                  t$        j&                  f      r| S t)        dt        |       d|       )za Helper method to :func:`sanitize_keys` to build ``deferred_removals`` and avoid deep recursion. r   r   )r   r%   r"   r   r!   ry   r   r   r    r   r   r   r   r   r#   rl   rj   r   r   r   r   )r   r   ignore_keysr   r   s        r|   _sanitize_keys_conditionsr      s)   %)[12%"e_-#UII  %!34%eZ(#UII  %!34%!e^,#UII  %!34%u]UD(4KLMN%(++X]];<
tE{EJ
KKr~   c                   |
t               }t        |       \  }}g }i }|dk(  rUt        | t              rEt        |t              r||d<   n/t        |t              rt        |j                               d   |d<   |D ]  }		 |j                   ||	fi |        |S # t        t        f$ rb}
d|z  }|r|ddj                  |      z  z  }|dt        |	      d|d	t        |
      z  }|j                  t        |             Y d }
~
d }
~
ww xY w)
Nrg   r   r   zElements value for option '%s'z found in '%s' -> z is of type " and we were unable to convert to : )r   r}   r   r$   ri   rh   r   r   r   r   joinry   r   r   )r   	parametervaluesr   r   r{   wanted_element_typevalidated_parameterskwargsr   r   r   s               r|   _validate_elementsr   &  s   ~/1(;K(H%L% Fe#
;(Mi.'F7O	4("9>>#34Q7F7O -	- ''U(Ef(EF-   :& 	-2Y>C'&++o*FFFtTY{\oqz{|q}~~CMM,s+,,	-s   ?BD*ADDc           	     l   |
t               }| j                         D ]  \  }}||vr||   }|#|j                  d      s|j                  d      6|j                  d      }t        |      \  }	}
i }|
dk(  r6t	        |t
              r&t        |j                               d   |d<   |r||d<   	  |	|fi |||<   |j                  d	d      }|rm||   }|d
k7  st	        |t              sAd|
d|d}|r|ddj                  |      z  z  }|dz  }|j                  t        |             t        |||||      ||<   " y# t        t        f$ rc}d|dt        |      }|r|ddj                  |      z  z  }|d|
dt        |      z  }|j                  t        |             Y d}~d}~ww xY w)a&  Validate that parameter types match the type in the argument spec.

    Determine the appropriate type checker function and run each
    parameter value through that function. All error messages from type checker
    functions are returned. If any parameter fails to validate, it will not
    be in the returned parameters.

    :arg argument_spec: Argument spec
    :type argument_spec: dict

    :arg parameters: Parameters
    :type parameters: dict

    :kwarg prefix: Name of the parent key that contains the spec. Used in the error message
    :type prefix: str

    :kwarg options_context: List of contexts?
    :type options_context: list

    :returns: Two item tuple containing validated and coerced parameters
              and a list of any errors that were encountered.
    :rtype: tuple

    Nr   r   ry   rg   r   r   r   r   rh   zInvalid type z for option ''z found in '%s'.r   z9, elements value check is supported only with 'list' typez
argument 'z' is of type r   r   )r   r   rw   r}   r   r$   rh   r   r   r   r   r   r   r   ry   r   )r   r   r   r   r   r   specr   r   r{   wanted_namer   elements_wanted_typer   r   r   s                   r|   _validate_argument_typesr   B  s   4 ~/1$**, &2t
"5!=*!5$((9:M:Uhhv&$7$D!k %J{L$I":??#45a8F7O #)x 	2 ,U =f =Ju#'88J#= #%e,&(
8T0J?JHUC&06;;3OOOVVCMM"3C"89$67KUT\^mou$v
5!?&2B :& 	238$u+FC(6;;+GGGiXYl[[CMM+C011	2s   0BEF3AF..F3c           	        |
t               }| j                         D ]I  \  }}|j                  d      }|t        |t        t
        t        f      rt        |t        t        f      s||v sSt        ||   t              r||   D cg c]	  }||vs| }}|sdj                  |D 	cg c]  }	t        |	       c}	      }
dj                  |D 	cg c]  }	t        |	       c}	      }d|d|
d|}|r!dj                  |dj                  |            }|j                  t        |             ||   |vs#||   d	k(  r*t        j                   |      }t#        |      d
k(  r|\  ||<   ||   dk(  r*t%        j                   |      }t#        |      d
k(  r|\  ||<   ||   |vsdj                  |D 	cg c]  }	t        |	       c}	      }
d|d|
d||   }|r!dj                  |dj                  |            }|j                  t        |             d|d|}|r!dj                  |dj                  |            }|j                  t'        |             L yc c}w c c}	w c c}	w c c}	w )zPEnsure all arguments have the requested values, and there are no stray argumentsNchoicesr   z	value of z must be one or more of: z. Got no match for: z{0} found in {1}r   Falser   Truez must be one of: z, got: z%internal error: choices for argument z are not iterable: )r   r   rw   r   	frozensetr   r   r"   r%   rh   r   r   r   r   r   r   intersectionlenr   r   )r   r   r   r   r   r   r   item	diff_listcchoices_strdiff_strr   overlaps                 r|   _validate_argument_valuesr    sO    ~/1$**, )2t((9%?g	8X>?
SZ]hjs\tHu
"j/62<U2C [$tSZGZ [I [ &*iiw0O!10O&P#'99I-Nqil-N#O`egrt|}*"4";";C_A]"^C&8&=>&g5 "%(G3"0"="=g"Fw<1,3:0Z.!%(F2"/"<"<W"Ew<1,3:0Z.!%(7&*iiw0O!10O&PKPR]_ijo_pq*"4";";C_A]"^C&8&=>TY[bcC(//V[[5QRMM+C01S)2 !\0O-N( 1Ps   
	I+I+,I0
I5
<I:
c	                   |g }|
t               }|
t               }|
t               }|
t               }| j                         D ]  \  }	}
|
j	                  d      }|dk(  s|dk(  s#|
j	                  dd      dk(  s9|
j	                  d      }|
j	                  dd	      r||j	                  |	      i ||	<   nv|	|	|vs||	   |j                  |	       t        ||	   t              rt        ||	   t              r||	   g}n||	   }t        |      D ]  \  }}|j                  t        ||             t        |t              s|j                  t        d
|	z               P||	z   }|dk(  r|d|z  z  }|dz  }g }g }	 t        ||||      }|D ]  \  }}t%        d||d||d        |Q|D ]L  }|j                  ||d   |j	                  d      |j	                  d      |j	                  d      d       N 	 |j                  t'        ||             t+        |||      }|j                  t-        |||||             	 t/        |
j	                  d      ||       |j                  t3        ||d	             	 t5        |||       t9        |||||       t;        ||||       t<        D ]"  }	  |d   |
j	                  |d         ||       $ |j                  t3        ||             t?        |||||||||	        |jA                           y# t        t        f$ r0}i }|j                  t!        t#        |                   Y d}~d}~ww xY w# t        $ r.}|j                  t)        t#        |                   Y d}~vd}~ww xY w# t        $ r.}|j                  t1        t#        |                   Y d}~gd}~ww xY w# t        $ r.}|j                  t7        t#        |                   Y d}~wd}~ww xY w# t        $ r.}|j                   |d   t#        |                   Y d}~d}~ww xY w)zAValidate sub argument spec.

    This function is recursive.
    Nry   ri   rh   r   r   r   apply_defaultsFz3value of '%s' must be of type dict or list of dictsz[%d].zBoth option z and its alias z	 are set.r   re   r   r   )r   re   r   r   )r   mutually_exclusiver   r:   r;   r<   )!r   r   ri   r   rw   r   r   r   r$   	enumerater   set_fallbacksr   r   r   r   r   r   r
   r   r   r   r   r(   r   r   r)   r   r   r  _ADDITIONAL_CHECKS_validate_sub_specpop)r   r   r   r   r   r   r   supported_parametersr   r   r   rz   sub_specr   idxr   
new_prefixr   alias_deprecations_suboptions_aliasesr   r   r   deprecationter   checks                              r|   r  r    s~     ~/1%!$##v%++- c"u6"V& 0UYYz25NRX5Xyy+Hyy)51'!~~e,4,.
5)!U*%<
5@Q@Y ""5) j/:jTYIZ\h>i&u-.%e,'0': KV#^$$]8^%LM!.$7MM"78mpu8u"vw $e^
V#&3,.Jc!
!#)+&<&5hP^`v&wO
 &4 sMFE:W]_ikpqrs &1'= *11.8+f:M$N'2y'A$/OOF$;/:?P/Q	3 =!(()<X~)VW  1>?[&--/ &$'(<H,UYY7K-Ln^mn $$]8^U%ST?,X~W )>:gmn)(NO\bc/ BEB%feiif&>P_`B $$]8^%LM #nj/6S`*,@BTVSKVZ !Gc"N ":. <&(OMM*Yq\":;;<$ ! =MM*Yr]";<<=  ! HMM"81"FGGH ! ?MM-	!"=>>? % BleEl9Q<&@AABsx   L M"NO:P M/%MM"	N+#NN	O%#OO	P#PP	Q	#Q	Q	c                 j    | D ])  }|t         j                  v st         j                  |   c S  t        )z$Load value from environment variable)osenvironr   )argsr   args      r|   env_fallbackr  >  s5      #"**::c?"# "!r~   c                R   t               }| j                         D ]z  \  }}|j                  dd      }|d   }g }i }||vs&|)|dd  D ]  }	t        |	t              r|	}|	} 	  ||i |}
|j                  dd      r|
r|j                  |
       |
||<   | |S # t        $ r Y w xY w)Nfallbackr   r   r   rK   F)r   r   rw   r   ri   r   r   )r   r   r   r   r   r  fallback_strategyfallback_argsfallback_kwargsr   fallback_values              r|   r  r  G  s    EM%++- 3u99Z1$QK
"'8'D  )dD)&*O$(M	)
3!2M!U_!U 99Xu-.!%%n5$2
5!%3(  + s   $B	B&%B&c                F   t               }|D cg c]  }t        |d       }}t        | |||      }|r|j                         \  }}t	        |t
              r^|j                         D ]J  \  }}	||v s|j                  d      rt        |	|||      ||<   -t        ||d      }
t        |	|||      ||
<   L nc|D ]^  }t        ||||      }t	        |t              r|j                  |       3t	        |t              r|j                  |       Ut        d       |r|S c c}w )aS  Sanitize the keys in a container object by removing ``no_log`` values from key names.

    This is a companion function to the :func:`remove_values` function. Similar to that function,
    we make use of ``deferred_removals`` to avoid hitting maximum recursion depth in cases of
    large data structures.

    :arg obj: The container object to sanitize. Non-container objects are returned unmodified.
    :arg no_log_strings: A set of string values we do not want logged.
    :kwarg ignore_keys: A set of string values of keys to not sanitize.

    :returns: An object with sanitized keys.
    r   r   _ansibleNzIUnknown container type encountered when removing private values from keys)r   r   r   popleftr   r   r   
startswithr   r!   r   r    r   r   )r   r   r   r   sr   old_datanew_dataold_keyold_elemnew_keyelemnew_elems                r|   sanitize_keysr0  `  s8    JXYQi*?@YNY)#~{L]^I
.668(h(%-^^%5 |!k)W-?-?
-K(A(N\giz({HW% 8QUVG(A(N\giz({HW%| ! q4T>;Xijh8OOH-*5LL*#$oppq , 3 Zs   Dc                   t               }|D cg c]  }t        |d       }}t        | ||      }|r|j                         \  }}t	        |t
              r+|j                         D ]  \  }}t        |||      }	|	||<    nb|D ]]  }
t        |
||      }	t	        |t              r|j                  |	       2t	        |t              r|j                  |	       Tt        d       |r|S c c}w )av  Remove strings in ``no_log_strings`` from value.

    If value is a container type, then remove a lot more.

    Use of ``deferred_removals`` exists, rather than a pure recursive solution,
    because of the potential to hit the maximum recursion depth when dealing with
    large amounts of data (see `issue #24560 <https://github.com/ansible/ansible/issues/24560>`_).
    r   r   zKUnknown container type encountered when removing private values from output)r   r   r   r&  r   r   r   r!   r   r    r   r   )r   r   r   r(  r   r)  r*  r+  r,  r/  r.  s              r|   remove_valuesr2    s     JXYQi*?@YNY)%ARSI
.668(h(%-^^%5 -!4X~O`a$,!- ! s4T>K\]h8OOH-*5LL*#$qrrs   ' Zs   C)r   )NNN)NN)r   )T)r   NN)r   NNNNNN)\
__future__r   r   r  collectionsr   	itertoolsr   'ansible.module_utils.common.collectionsr   +ansible.module_utils.common.text.convertersr   r   r	   $ansible.module_utils.common.warningsr
   ansible.module_utils.errorsr   r   r   r   r   r   r   r   r   r   r   r   r   r   )ansible.module_utils.parsing.convert_boolr   r   .ansible.module_utils.six.moves.collections_abcr   r   r   r   r   r    r!   ansible.module_utils.sixr"   r#   r$   r%   r&   r'   &ansible.module_utils.common.validationr(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   ry   r   r  	PASS_VARS
PASS_BOOLSrv   r}   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r   r0  r2   r~   r|   <module>rA     sR  
 #  	   ? T T 5     T       * : %.AJ_`",=FXYoNoN	 '  6	
 : ?  ' 1 02bc - $  E 3   "!" )#	( c
 !   6=&"R6r3l-`D.[|"J#LL 8C2L/2j A"H"2 4=; )Xr~   