404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.21.105.222: ~ $
3

\�me��@s�ddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZej
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�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)rrrr �_get_sysinfo2szDataSourceUpCloud._get_sysinfocCstj|j|j|j|jd�S)N)rZsec_betweenr
)r!Z
read_metadatarrrr
)rrrr �_read_metadata5s
z DataSourceUpCloud._read_metadatacCs�|j�\}}|sdStjd|�|jr�yNtjd�tj�}tjd|�t|j|��t	j
tjd|jd�}WdQRXWn6tt
jfk
r�}zt	jtt|��dSd}~XnXndy"tjd�t	j
tjd|jd�}Wn@t
jk
�r}z t	jtt|��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_nicrrrZlog_timer#rrZInvalidMetaDataExceptionZlogexc�strZ
metadata_fullrrZvendordata_rawZuserdata_raw)rZ
is_upcloudZserver_uuidZnicZmd�errr �	_get_data=sN
zDataSourceUpCloud._get_datacCstj|j��S)N)rZinstance_id_matches_system_uuidZget_instance_id)rrrrr �check_instance_idrsz#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�RuntimeErrorr!Zconvert_network_config)rZraw_network_configrrr �network_configusz DataSourceUpCloud.network_configN)�__name__�
__module__�__qualname__Zdsnamer*rr"r#r/r0�propertyr2rrrr 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)r3r4r5�__doc__r*rrrr r7�sr7cCstj|t�S)N)rZlist_from_depends�datasources)Zdependsrrr �get_datasource_list�sr:)ZloggingZ	cloudinitrr,rrZcloudinit.net.dhcprZcloudinit.net.ephemeralrZcloudinit.sources.helpersrr!Z	getLoggerr3r(rrrrrrr7ZDEP_FILESYSTEMZDEP_NETWORKr9r:rrrr �<module>s
r


Filemanager

Name Type Size Permission Actions
DataSourceAkamai.cpython-36.opt-1.pyc File 8.18 KB 0644
DataSourceAkamai.cpython-36.pyc File 8.18 KB 0644
DataSourceAliYun.cpython-36.opt-1.pyc File 3.22 KB 0644
DataSourceAliYun.cpython-36.pyc File 3.22 KB 0644
DataSourceAltCloud.cpython-36.opt-1.pyc File 6.74 KB 0644
DataSourceAltCloud.cpython-36.pyc File 6.74 KB 0644
DataSourceAzure.cpython-36.opt-1.pyc File 47.95 KB 0644
DataSourceAzure.cpython-36.pyc File 47.95 KB 0644
DataSourceBigstep.cpython-36.opt-1.pyc File 1.84 KB 0644
DataSourceBigstep.cpython-36.pyc File 1.84 KB 0644
DataSourceCloudSigma.cpython-36.opt-1.pyc File 3.62 KB 0644
DataSourceCloudSigma.cpython-36.pyc File 3.62 KB 0644
DataSourceCloudStack.cpython-36.opt-1.pyc File 5.97 KB 0644
DataSourceCloudStack.cpython-36.pyc File 5.97 KB 0644
DataSourceConfigDrive.cpython-36.opt-1.pyc File 8.18 KB 0644
DataSourceConfigDrive.cpython-36.pyc File 8.18 KB 0644
DataSourceDigitalOcean.cpython-36.opt-1.pyc File 3.65 KB 0644
DataSourceDigitalOcean.cpython-36.pyc File 3.65 KB 0644
DataSourceEc2.cpython-36.opt-1.pyc File 23.49 KB 0644
DataSourceEc2.cpython-36.pyc File 23.49 KB 0644
DataSourceExoscale.cpython-36.opt-1.pyc File 5.92 KB 0644
DataSourceExoscale.cpython-36.pyc File 5.92 KB 0644
DataSourceGCE.cpython-36.opt-1.pyc File 9.83 KB 0644
DataSourceGCE.cpython-36.pyc File 9.93 KB 0644
DataSourceHetzner.cpython-36.opt-1.pyc File 3.78 KB 0644
DataSourceHetzner.cpython-36.pyc File 3.78 KB 0644
DataSourceIBMCloud.cpython-36.opt-1.pyc File 12.44 KB 0644
DataSourceIBMCloud.cpython-36.pyc File 12.44 KB 0644
DataSourceLXD.cpython-36.opt-1.pyc File 13.31 KB 0644
DataSourceLXD.cpython-36.pyc File 13.31 KB 0644
DataSourceMAAS.cpython-36.opt-1.pyc File 11.86 KB 0644
DataSourceMAAS.cpython-36.pyc File 11.86 KB 0644
DataSourceNWCS.cpython-36.opt-1.pyc File 3.77 KB 0644
DataSourceNWCS.cpython-36.pyc File 3.77 KB 0644
DataSourceNoCloud.cpython-36.opt-1.pyc File 7.97 KB 0644
DataSourceNoCloud.cpython-36.pyc File 7.97 KB 0644
DataSourceNone.cpython-36.opt-1.pyc File 1.47 KB 0644
DataSourceNone.cpython-36.pyc File 1.47 KB 0644
DataSourceOVF.cpython-36.opt-1.pyc File 9.15 KB 0644
DataSourceOVF.cpython-36.pyc File 9.15 KB 0644
DataSourceOpenNebula.cpython-36.opt-1.pyc File 11.75 KB 0644
DataSourceOpenNebula.cpython-36.pyc File 11.75 KB 0644
DataSourceOpenStack.cpython-36.opt-1.pyc File 7.91 KB 0644
DataSourceOpenStack.cpython-36.pyc File 7.91 KB 0644
DataSourceOracle.cpython-36.opt-1.pyc File 10.99 KB 0644
DataSourceOracle.cpython-36.pyc File 10.99 KB 0644
DataSourceRbxCloud.cpython-36.opt-1.pyc File 7.19 KB 0644
DataSourceRbxCloud.cpython-36.pyc File 7.19 KB 0644
DataSourceScaleway.cpython-36.opt-1.pyc File 10.84 KB 0644
DataSourceScaleway.cpython-36.pyc File 10.84 KB 0644
DataSourceSmartOS.cpython-36.opt-1.pyc File 24.51 KB 0644
DataSourceSmartOS.cpython-36.pyc File 24.51 KB 0644
DataSourceUpCloud.cpython-36.opt-1.pyc File 4.36 KB 0644
DataSourceUpCloud.cpython-36.pyc File 4.36 KB 0644
DataSourceVMware.cpython-36.opt-1.pyc File 23.66 KB 0644
DataSourceVMware.cpython-36.pyc File 23.66 KB 0644
DataSourceVultr.cpython-36.opt-1.pyc File 3.44 KB 0644
DataSourceVultr.cpython-36.pyc File 3.44 KB 0644
__init__.cpython-36.opt-1.pyc File 30.52 KB 0644
__init__.cpython-36.pyc File 30.52 KB 0644