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: //usr/lib/python3.9/site-packages/ansible/utils/__pycache__/vars.cpython-39.pyc
a

�)g�'�@s:ddlmZmZmZeZddlZddlZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZddlmZmZddlmZmZdd	lmZmZdd
lmZed�ZdZda d
e�!�dd�Z"de�#de�dd�Z$dd�Z%dd�Z&d$dd�Z'd%dd�Z(dd�Z)dd�Z*dd �Z+d!d"�Z,e�r,e+Z-ne,Z-d#e-_.dS)&�)�absolute_import�division�print_functionN)�MutableMapping�MutableSequence)�dumps)�	constants)�context)�AnsibleError�AnsibleOptionsError)�string_types�PY3)�	to_native�to_text)�parse_kv)�True�False�Nonel�%012x�z%08x�c	CsHtd7ad�tdd�tdd�tdd�tdd�dtdd�g�S)N��-rrr�r)�cur_id�join�node_mac�
random_int�rr�6/usr/lib/python3.9/site-packages/ansible/utils/vars.py�
get_unique_id-s



�r c	Cs�t|t�rt|t�s~g}||fD]8}z|�t|��Wq tyV|�t|��Yq 0q td�|jj	|jj	|d|d���dS)z�
    Internal convenience function to ensure arguments are MutableMappings

    This checks that all arguments are MutableMappings or raises an error

    :raises AnsibleError: if one of the arguments is not a MutableMapping
    zQfailed to combine variables, expected dicts but got a '{0}' and a '{1}': 
{2}
{3}rrN)
�
isinstancer�appendr�	Exceptionrr
�format�	__class__�__name__)�a�bZmyvars�xrrr�_validate_mutable_mappings9s�r*cCs:|s|dur tjdkr t||�St||�||B}|SdS)zV
    Return a copy of dictionaries of variables based on configured hash behavior
    N�merge)�CZDEFAULT_HASH_BEHAVIOUR�
merge_hashr*)r'r(r+�resultrrr�combine_varsQs


r/T�replacecsf|dvrtd��t||�|iks*||kr2|��S|��}|sT|dkrT|�|�|S|��D�]\}�||vrx�||<q\||}t|t�r�t�t�r�|r�t|�||�||<q\�||<q\t|t��rXt�t��rX|dkr�||<q\|dkr�|�||<q\|dk�r�|||<q\|dk�r4�fdd�|D��||<q\|d	kr\��fd
d�|D�||<q\�||<q\|S)z�
    Return a new dictionary result of the merges of y into x,
    so that keys from y take precedence over keys from x.
    (x and y aren't modified)
    )r0Zkeepr"�prepend�	append_rp�
prepend_rpzzmerge_hash: 'list_merge' argument can only be equal to 'replace', 'keep', 'append', 'prepend', 'append_rp' or 'prepend_rp'r0r"r1r2csg|]}|�vr|�qSrr��.0�z�Zy_valuerr�
<listcomp>��zmerge_hash.<locals>.<listcomp>r3csg|]}|�vr|�qSrrr4r7rrr8�r9)	r
r*�copy�update�itemsr!rr-r)r)�y�	recursiveZ
list_merge�keyZx_valuerr7rr-_sB





r-cCs�i}tj�dt��D]�}d}t|dd�}|dus|s6q|�d�rT|�|dd��}n:|ddvrntd|��n |dd	vr�|�|�}nt	|�}t
|t�r�t||�}qtd
|��q|S)N�
extra_varsZsurrogate_or_strict)�errors�@rr)�/�.z0Please prepend extra_vars filename '%s' with '@')�[�{zJInvalid extra vars data supplied. '%s' could not be made into a dictionary)
r	�CLIARGS�get�tupler�
startswithZload_from_filer�loadrr!rr/)�loaderr@Zextra_vars_opt�datarrr�load_extra_vars�s"

rNc	Cs`|durd}d|i}ddddddd	d
d�}|��D](\}}tj�|�}|dur2||d|<q2|S)
NZUnknownZansible_versionZ
check_modeZ	diff_mode�forksZinventory_sources�	skip_tags�limitZrun_tags�	verbosity)�check�diffrOZ	inventoryrPZsubset�tagsrRz
ansible_%s)r<r	rGrH)�versionZoptions_vars�attrs�attr�alias�optrrr�load_options_vars�s"�	r[cCsPt|t�sdSz|�d�Wnty0YdS0|��s>dSt�|�rLdSdS)NF�asciiT)r!r�encode�UnicodeEncodeError�isidentifier�keyword�	iskeyword��identrrr�_isidentifier_PY3�s

rdcCs@t|t�sdS|sdStj�|�r&dSt�|�s8|tvr<dSdS)NFT)r!rr,ZINVALID_VARIABLE_NAMES�searchr`ra�ADDITIONAL_PY2_KEYWORDSrbrrr�_isidentifier_PY2�s
rga.Determine if string is valid identifier.

The purpose of this function is to be used to validate any variables created in
a play to be valid Python identifiers and to not conflict with Python keywords
to prevent unexpected behavior. Since Python 2 and Python 3 differ in what
a valid identifier is, this function unifies the validation so playbooks are
portable between the two. The following changes were made:

    * disallow non-ascii characters (Python 3 allows for them as opposed to Python 2)
    * True, False and None are reserved keywords (these are reserved keywords
      on Python 3 as opposed to Python 2)

:arg ident: A text string of identifier to check. Note: It is callers
    responsibility to convert ident to text if it is not already.

Originally posted at http://stackoverflow.com/a/29586366
)N)Tr0)/Z
__future__rrr�typeZ
__metaclass__r`ZrandomZuuid�collections.abcrrZjsonrZansiblerr,r	Zansible.errorsr
rZansible.module_utils.sixrr
Zansible.module_utils._textrrZansible.parsing.splitterr�	frozensetrfZ_MAXSIZErZgetnoderZrandintrr r*r/r-rNr[rdrgr_�__doc__rrrr�<module>s:

X