403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/sources/__pycache__/DataSourceUpCloud.cpython-36.pyc
3

��b��@s�ddlmZddlmZddlmZmZddlmZm	Z	ddl
mZej
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�tjj||||�||_t�|_tjtj|ddgi�t	g�|_
|j
d|_|j
jdt
�|_|j
jdt�|_|j
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 �'/usr/lib/python3.6/DataSourceUpCloud.pyr s
zDataSourceUpCloud.__init__cCstj�S)N)�	uc_helperZread_sysinfo)rr r r!�_get_sysinfo0szDataSourceUpCloud._get_sysinfocCstj|j|j|j|jd�S)N)rZsec_betweenr)r"Z
read_metadatarrrr)rr r r!�_read_metadata3s
z DataSourceUpCloud._read_metadatacCs�|j�\}}|sdStjd|�|jr�yJtjd�tj�}tjd|�t|��tj	tjd|j
d�}WdQRXWn6ttj
fk
r�}ztjtt|��dSd}~XnXndy"tjd�tj	tjd|j
d�}Wn@tj
k
�r}z tjtt|��tjd|�dSd}~XnX||_|jd	|�|jd
<|jd�|jd<|jd
�|jd
<|jd�|jd<|jdd�|jd<|jdd�|_|jdd�|_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-idZhostnamezlocal-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;sN

zDataSourceUpCloud._get_datacCstj|j��S)N)rZinstance_id_matches_system_uuidZget_instance_id)rrr r r!�check_instance_idpsz#DataSourceUpCloud.check_instance_idcCs6|jr|jS|jjd�}|s$td��tj|�|_|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$r0r1�propertyr3r 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)r4r5r6�__doc__r+r r r r!r8�sr8cCstj|t�S)N)rZlist_from_depends�datasources)Zdependsr r r!�get_datasource_list�sr;N)Z	cloudinitrZloggingrr-rrZcloudinit.net.dhcprrZcloudinit.sources.helpersrr"Z	getLoggerr4r)rrrrrrr8ZDEP_FILESYSTEMZDEP_NETWORKr:r;r r r r!�<module>s
p


Youez - 2016 - github.com/yon3zu
LinuXploit