403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/plugins/lookup/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/plugins/lookup/__pycache__/ini.cpython-311.opt-1.pyc
�

���cc���ddlmZmZmZeZdZdZdZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZdd	lmZmZdd
lmZmZddlmZd�ZGd
�de��ZdS)�)�absolute_import�division�print_functiona�
    name: ini
    author: Yannig Perre (!UNKNOWN) <yannig.perre(at)gmail.com>
    version_added: "2.0"
    short_description: read data from an ini file
    description:
      - "The ini lookup reads the contents of a file in INI format C(key1=value1).
        This plugin retrieves the value on the right side after the equal sign C('=') of a given section C([section])."
      - "You can also read a property file which - in this case - does not contain section."
    options:
      _terms:
        description: The key(s) to look up.
        required: True
      type:
        description: Type of the file. 'properties' refers to the Java properties files.
        default: 'ini'
        choices: ['ini', 'properties']
      file:
        description: Name of the file to load.
        default: 'ansible.ini'
      section:
        default: global
        description: Section where to lookup the key.
      re:
        default: False
        type: boolean
        description: Flag to indicate if the key supplied is a regexp.
      encoding:
        default: utf-8
        description:  Text encoding to use.
      default:
        description: Return value if the key is not in the ini file.
        default: ''
      case_sensitive:
        description:
          Whether key names read from C(file) should be case sensitive. This prevents
          duplicate key errors if keys only differ in case.
        default: False
        version_added: '2.12'
      allow_no_value:
        description:
        - Read an ini file which contains key without value and without '=' symbol.
        type: bool
        default: False
        aliases: ['allow_none']
        version_added: '2.12'
a�
- ansible.builtin.debug: msg="User in integration is {{ lookup('ansible.builtin.ini', 'user', section='integration', file='users.ini') }}"

- ansible.builtin.debug: msg="User in production  is {{ lookup('ansible.builtin.ini', 'user', section='production',  file='users.ini') }}"

- ansible.builtin.debug: msg="user.name is {{ lookup('ansible.builtin.ini', 'user.name', type='properties', file='user.properties') }}"

- ansible.builtin.debug:
    msg: "{{ item }}"
  loop: "{{ q('ansible.builtin.ini', '.*', section='section1', file='test.ini', re=True) }}"

- name: Read an ini file with allow_no_value
  ansible.builtin.debug:
    msg: "{{ lookup('ansible.builtin.ini', 'user', file='mysql.ini', section='mysqld', allow_no_value=True) }}"
z`
_raw:
  description:
    - value(s) of the key(s) in the ini file
  type: list
  elements: str
N)�StringIO)�defaultdict)�MutableSequence)�AnsibleLookupError�AnsibleOptionsError)�to_text�	to_native)�
LookupBasec�Z��|���}td����g}d}t|�����D]S\}}d|vr|D]}d|z|vr|}�|dks�|s|�|<|�|���@�|xxd|zz
cc<�T�fd�|D��S)z.Safely split parameter term to preserve spacesc��dS)N��r��?/usr/lib/python3.11/site-packages/ansible/plugins/lookup/ini.py�<lambda>z_parse_params.<locals>.<lambda>as���r�key�=z%s=r� c� ��g|]
}�|��Srr)�.0�x�paramss  �r�
<listcomp>z!_parse_params.<locals>.<listcomp>ws���$�$�$�!�F�1�I�$�$�$r)�keysr�	enumerate�split�append)	�term�	paramvals�
valid_keysr�thiskey�idp�phrase�krs	        @r�
_parse_paramsr(\s�������!�!�J�
���
$�
$�F��D��G� ������.�.�,�,���V��&�=�=��
 �
 ���A�I�&�(�(��G���!�8�8�6�'�?�8�$�F�7�O��K�K�� � � � �
�7�O�O�O�s�V�|�+�O�O�O�O�%�$�$�$�t�$�$�$�$rc��eZdZd�Zdd�ZdS)�LookupModulec����|r&�fd�|j�|��D��Sd}	|j�|���}n#tj$r|cYSwxYw|S)Nc�D��g|]\}}tj�|���|��Sr)�re�match)rr'�vrs   �rrz*LookupModule.get_value.<locals>.<listcomp>s.���M�M�M�$�!�Q�B�H�S�!�<L�<L�M�A�M�M�Mr)�cp�items�get�configparser�
NoOptionError)�selfr�section�dflt�	is_regexp�values `    r�	get_valuezLookupModule.get_value|s�����	N�M�M�M�M�$�'�-�-��"8�"8�M�M�M�M���	��G�K�K���-�-�E�E���)�	�	�	��K�K�K�	�����s�A	�	A�ANc��|�||���|���}tj|�d|�d�������|_|drt|j_g}|D�]�}|}d|vsd|���vr�|�	��t||��}	d}	|D]D}
d|
vr4|
�d��\}}||vrtd	|z���|||<�:||kr|
}d
}	�En9#t$r,}
td|
�d|�d
t
|
����|
����d}
~
wwxYw|	std|z���|�|d|d��}t!��}|ddkr|�d��d|d<|j�|��\}}t)|d|d���}|�|��|�dt,j��	|j�|��nN#tj$r<}td�|dt
|��������d}~wwxYw	|�||d|d|d��}nC#tj$r1td�|d|d� �����wxYw|�Ft;|t<��r|D]}|�|������|�|�����|S)!N)�var_options�direct�allow_no_value�
allow_none)r>�case_sensitiverrFz%s is not a valid option.TzCould not use 'z' from 'z': )�orig_exczMNo key to lookup was provided as first term with in string inline options: %s�files�file�type�
propertiesz[java_properties]
�java_propertiesr6�surrogate_or_strict�encoding)�errorsrHrz%Duplicate option in '{file}': {error})rC�error�defaultr-z No section '{section}' in {file})r6rC) �set_options�get_optionsr3�ConfigParserr2r0r�optionxform�strip�_deprecate_inline_kvr(rr	�
ValueErrorr
�find_file_in_search_pathr�write�_loader�_get_file_contentsr�seek�os�SEEK_SET�readfp�DuplicateOptionError�formatr:�NoSectionError�
isinstancerr )r5�terms�	variables�kwargsr"�retr!rr�updated_key�param�namer9�e�path�config�contents�	show_data�doe�varr/s                     r�runzLookupModule.run�s
�����Y�v��>�>�>��$�$�&�&�	��+�9�=�=�IY�[d�[h�[h�iu�[v�[v�;w�;w�x�x�x����%�&�	,�"+�D�G�����9	$�9	$�D��C��d�{�{�c�T�Z�Z�\�\�1�1��)�)�+�+�+�&�t�Y�7�7��}�"'�K�!'�	/�	/���%�<�<�*/�+�+�c�*:�*:�K�D�%�#�9�4�4�&8�9T�W[�9[�&\�&\� \�.3�I�d�O�O� �D�[�[�"'�C�*.�K��	/��"�}�}�}�,�,�SX�SX�SX�Z`�Z`�Z`�bk�lm�bn�bn�bn�-o�z{�|�|�|�|�����}����#�F�-�.}�AE�/E�F�F�F�
�0�0��G�Y�v�EV�W�W�D��Z�Z�F��� �L�0�0����3�4�4�4�'8�	�)�$�#'�,�"A�"A�$�"G�"G��H�i��x�0E�PY�Zd�Pe�f�f�f�H��L�L��"�"�"��K�K��2�;�'�'�'�
G�����v�&�&�&�&���4�
G�
G�
G�(�)P�)W�)W�]f�gm�]n�v�AD�wE�wE�)W�*F�*F�G�G�G�����
G����
J��n�n�S�)�I�*>�	�)�@T�V_�`d�Ve�f�f�����.�
J�
J�
J�(�)K�)R�)R�[d�en�[o�v�AG�wH�)R�*I�*I�J�J�J�
J�������c�?�3�3�$� �&�&���
�
�1�
�
�
�
�&��J�J�s�O�O�O���
s>�A	D�
E�"'E	�	E�!H<�<J�7J�J�*J6�6AK6)N)�__name__�
__module__�__qualname__r:rmrrrr*r*zs=������
�
�
�D�D�D�D�D�Drr*)�
__future__rrrrD�
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURNr3rXr-�ior�collectionsr�collections.abcr�ansible.errorsr	r
�ansible.module_utils._textrr�ansible.plugins.lookupr
r(r*rrr�<module>r|s&��C�B�B�B�B�B�B�B�B�B��
�.�
�`�� 
������	�	�	�	�	�	�	�	�������#�#�#�#�#�#�+�+�+�+�+�+�B�B�B�B�B�B�B�B�9�9�9�9�9�9�9�9�-�-�-�-�-�-�%�%�%�<R�R�R�R�R�:�R�R�R�R�Rr

Youez - 2016 - github.com/yon3zu
LinuXploit