HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/sources/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceVultr.cpython-311.pyc
�

܍~c����ddlmcmcmZddlmZddlmZmZmZeje	��Z
dddddej���d	ej��d
�dej��d��d
�Z
Gd�dej��ZeejffgZd�Ze	dkr�ddlZej��sed��ejd��eje
de
de
de
de
d��ZedZej��Zeeje����eeje����dSdS)�N)�log)�sources�util�versionzhttp://169.254.169.254��
�zCloud-Init/z - OS: �systemz
 Variant: �variant)�url�retries�timeout�wait�
user-agentc�f��eZdZdZ�fd�Zd�Zd�Zd�Zd�Ze	d���Z
e	d���Z�xZS)	�DataSourceVultr�Vultrc����tt|���|||��tjtj|ddgi��tg��|_dS)N�
datasourcer)�superr�__init__r�
mergemanydict�get_cfg_by_path�BUILTIN_DS_CONFIG�ds_cfg)�self�sys_cfg�distro�paths�	__class__s    ��C/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceVultr.pyrzDataSourceVultr.__init__s\���
�o�t�$�$�-�-�g�v�u�E�E�E��(��$�W�|�W�.E�r�J�J�!�
�
�
�����c��t�d��tj��st�d��dSt�d��|���|_|jd|jd<|jd|jd<|jd	d
}d|jd	vr|jd	d}|���|jd	<|jd|_|�|j��t�d
��t�tj
|jd����t�d|jd��t�d|jd��|j�9t�d��t�|j��dS)Nz(Detecting if machine is a Vultr instance�Machine is not a Vultr instanceFzMachine is a Vultr instancezinstance-v2-idzinstance-id�hostname�local-hostname�region�
regioncode�countrycode�	user-datazVultr Vendor Config:�vendor-dataz	SUBID: %szHostname: %sz
User-Data:T)�LOG�debug�vultr�is_vultr�get_metadata�metadata�lower�userdata_raw�get_datasource_datar�
json_dumps)rr's  r!�	_get_datazDataSourceVultr._get_data)s����	�	�<�=�=�=��~���	��I�I�7�8�8�8��5��	�	�/�0�0�0��)�)�+�+��
�'+�}�5E�'F��
�m�$�*.�-�
�*C��
�&�'���x�(��6���D�M�(�3�3�3��]�8�,�]�;�F�"(�,�,�.�.��
�h�� �M�+�6���	
� � ���/�/�/�	�	�	�(�)�)�)��	�	�$�/�$�-�
�">�?�?�@�@�@��	�	�+�t�}�]�;�<�<�<��	�	�.�$�-�0@�"A�B�B�B���(��I�I�l�#�#�#��I�I�d�'�(�(�(��tr"c��d|vr tj|d��|_ntj|d��|_|d|_|jddkr
d|jd<|d|_|jdkr	d|_dSdS)N�cloud_interfaces�
interfacesr+r&��guestr*)r.�add_interface_names�netcfg�generate_network_config�vendordata_rawr1r3)r�mds  r!r4z#DataSourceVultr.get_datasource_dataJs�����#�#� �3�B�7I�4J�K�K�D�K�K��7��<�8H�I�I�D�K�!��/����=�)�*�b�0�0�.5�D�M�*�+��{�O������"�"� $�D����#�"r"c	���tj|jd|jd|jd|jd|jd|j������S)Nrrr
rr)�tmp_dir)r.r0rr�get_tmp_exec_path�rs r!r0zDataSourceVultr.get_metadata_s_���!��K����K�	�"��K�	�"��K����K��%��K�1�1�3�3�

�
�
�	
r"c��tj��sdStj��rdStj��d}t	j|��S)NF�subid)r.r/�is_baremetal�get_sysinfor�instance_id_matches_system_uuid)rrrFs   r!�check_instance_idz!DataSourceVultr.check_instance_idjsS���~���	��5�����	��5��!�#�#�G�,���6�u�=�=�=r"c��dS�N�rDs r!�launch_indexzDataSourceVultr.launch_indexvs���tr"c��|jSrL)r=rDs r!�network_configzDataSourceVultr.network_configzs
���{�r")
�__name__�
__module__�__qualname__�dsnamerr6r4r0rJ�propertyrNrP�
__classcell__)r s@r!rrs��������
�F�
�
�
�
�
����B%�%�%�*
�
�
�	>�	>�	>�����X������X�����r"rc�6�tj|t��SrL)r�list_from_depends�datasources)�dependss r!�get_datasource_listr[�s���$�W�k�:�:�:r"�__main__r$�rrr
rrr+)�cloudinit.sources.helpers.vultrr�helpersr.�	cloudinitrrr�	getLoggerrQr,�version_string�system_infor�
DataSourcer�DEP_FILESYSTEMrYr[�sysr/�print�exitr0r@�configrH�sysinfor5rMr"r!�<module>rks��0�/�/�/�/�/�/�/�/�/�/�/� � � � � � �,�,�,�,�,�,�,�,�,�,��c�m�H����#���
�A�	��� � � � ������8�$�$�$������9�%�%�	����a�a�a�a�a�g�(�a�a�a�L�w�-�/�0���;�;�;��z����J�J�J��5�>����
��/�0�0�0��������	��	��%� ��)�$��)�$��&�!��,�'�
�
�B��
�
�F��e��!�!�G�	�E�/�$�/�'�
"�
"�#�#�#�	�E�/�$�/�&�
!�
!�"�"�"�"�"�%�r"