%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/sources/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceDigitalOcean.cpython-312.pyc

�

�f����ddlZddlmcmcmZddlmZmZeje	�Z
ddiZdZdZ
dZdZGd�d	ej �Zeej$ffgZd
�Zy)�N)�sources�util�metadata_urlz'http://169.254.169.254/metadata/v1.json��Tc�Z��eZdZdZd�Zdeddf�fd�Zd�Zd�Zd	�Z	d
�Z
ed��Z�xZ
S)�DataSourceDigitalOcean�DigitalOceanc�`�tjj||||�||_t	�|_t
jt
j|ddgi�tg�|_
|j�|jd|_|jjdt�|_|jjdt �|_|jjdt$�|_|jjdt(�|_d|_y)N�
datasourcer
r�retries�timeout�	use_ip4LL�
wait_retry)r�
DataSource�__init__�distro�dict�metadatar�
mergemanydict�get_cfg_by_path�BUILTIN_DS_CONFIG�ds_cfg�
_deprecate�metadata_address�get�
MD_RETRIESr
�
MD_TIMEOUTr�
MD_USE_IPV4LLr�
MD_WAIT_RETRYr�_network_config)�self�sys_cfgr�pathss    �J/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceDigitalOcean.pyrzDataSourceDigitalOcean.__init__ s������#�#�D�'�6�5�A�������
��(�(��$�$��l�N�;�R��"�	
�
���	
���� $���N� ;����{�{���y�*�=����{�{���y�*�=���������m�D����+�+�/�/�,�
�F���#����ci_pkl_version�returnNc�D��t�|�|�|j�y�N)�super�	_unpickler)r"r'�	__class__s  �r%r,z DataSourceDigitalOcean._unpickle4s���
���.�)����r&c�4�tjddd��y)Nr	z23.2z.Deprecated in favour of DataSourceConfigDrive.)�
deprecated�deprecated_version�
extra_message)r�	deprecate�r"s r%rz!DataSourceDigitalOcean._deprecate8s�����/�%�J�	
r&c�*�tj�Sr*)�	do_helper�read_sysinfor3s r%�_get_sysinfoz#DataSourceDigitalOcean._get_sysinfo?s���%�%�'�'r&c��|j�\}}|sytjd|�d}|jrt	j
|j�}t	j|j|j|j|j��}||_|jd|�|jd<|jd|�|jd<|jd�|jd<|jd	�|jd
<|jdd�|jd
<|jdd�|_|jdd�|_|rt	j"|�y)NFz&Running on DigitalOcean. droplet_id=%s)r�sec_betweenr
�
droplet_idzinstance-id�hostnamezlocal-hostname�
interfaces�public_keyszpublic-keys�region�default�availability_zone�vendor_data�	user_dataT)r7�LOG�inforr5�assign_ipv4_link_localr�
read_metadatarrrr
�
metadata_fullrr�vendordata_raw�userdata_raw�del_ipv4_link_local)r"�is_dor:�
ipv4LL_nic�mds     r%�	_get_dataz DataSourceDigitalOcean._get_dataBs9��"�/�/�1���
������9�:�F��
��>�>�"�9�9�$�+�+�F�J�
�
$�
$��!�!��L�L�����L�L�	
�� ���')�v�v�l�J�'G��
�
�m�$�*,�&�&��Z�*H��
�
�&�'�&(�f�f�\�&:��
�
�l�#�')�v�v�m�'<��
�
�m�$�-/�V�V�H�i�-H��
�
�)�*� �f�f�]�D�9����F�F�;��5�����)�)�*�5�r&c�J�tj|j�d�S)Nzsystem-serial-number)r�instance_id_matches_system_uuid�get_instance_id)r"r#s  r%�check_instance_idz(DataSourceDigitalOcean.check_instance_idds$���6�6�� � �"�$:�
�	
r&c��|jr|jS|jjd�}tj	|�|std��|jdd}tj||�|_|jS)z�Configure the networking. This needs to be done each boot, since
        the IP information may have changed due to snapshot and/or
        migration.
        r<z'Unable to get meta-data from server....�dns�nameservers)	r!rrrC�debug�RuntimeErrorrGr5�convert_network_configuration)r"r<rUs   r%�network_configz%DataSourceDigitalOcean.network_configis�������'�'�'��]�]�&�&�|�4�
��	�	�*����H�I�I��(�(��/�
�>��(�F�F��� 
����#�#�#r&)�__name__�
__module__�__qualname__�dsnamer�intr,rr7rNrR�propertyrY�
__classcell__)r-s@r%r	r	sI���
�F�$�(�����
�(� �D
�
�$��$r&r	c�6�tj|t�Sr*)r�list_from_depends�datasources)�dependss r%�get_datasource_listre�s���$�$�W�k�:�:r&)�logging�&cloudinit.sources.helpers.digitaloceanr�helpers�digitaloceanr5�	cloudinitr�	getLoggerrZrCrrrr rrr	�DEP_FILESYSTEMrcre�r&r%�<module>rns���:�:�#��g����!���=����
�
�
��
��
�`$�W�/�/�`$�J�g�4�4�6�7���;r&

Zerion Mini Shell 1.0