404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.220.193.90: ~ $
3

\�meB�@s�dZddlZddljjjZddlmZm	Z	mZm
Z
ddlmZddl
mZeje�ZdZededd	�Zd
ZdZdZGdd
�d
ej�Zdd�ZeejffgZdd�ZdS)z>Hetzner Cloud API Documentation
   https://docs.hetzner.cloud/�N)�dmi�net�sources�util)�NoDHCPLeaseError)�EphemeralDHCPv4z!http://169.254.169.254/hetzner/v1z	/metadataz	/userdata)�metadata_url�userdata_url�<�c@s4eZdZdZdd�Zdd�Zdd�Zedd	��Zd
S)�DataSourceHetzner�HetznercCs�tjj||||�||_t�|_tjtj|ddgi�t	g�|_
|j
d|_|j
d|_|j
j
dt�|_|j
j
dt�|_|j
j
dt�|_tj|_tj|_dS)NZ
datasourcer
rr	�retries�timeout�
wait_retry)r�
DataSource�__init__�distro�dict�metadatarZ
mergemanydictZget_cfg_by_path�BUILTIN_DS_CONFIGZds_cfg�metadata_address�userdata_address�get�
MD_RETRIESr�
MD_TIMEOUTr�
MD_WAIT_RETRYr�UNSET�_network_configZDSMODE_NETWORKZdsmode)�self�sys_cfgr�paths�r"�'/usr/lib/python3.6/DataSourceHetzner.pyr"s
zDataSourceHetzner.__init__cCst�\}}|sdSy`t|jtj�dtdid��:tj|j|j	|j
|jd�}tj|j
|j	|j
|jd�}WdQRXWn0tk
r�}ztjd|��WYdd}~XnXtj|�|_||_|d|jd<|d|jd	<|jd
d�|jd
<|jdd�|jd<|jdd�|_|j�|k�rtd
��dS)NFZurlz/metadata/instance-id)ZifaceZconnectivity_url_data)rZsec_betweenrzBailing, DHCP Exception: %szinstance-idZhostnamezlocal-hostnameznetwork-configzpublic-keysZvendor_dataz6SMBIOS serial does not match instance ID from metadataT)�get_hcloud_datarrrZfind_fallback_nic�BASE_URL_V1�	hc_helperZ
read_metadatarrrrZ
read_userdatarr�LOG�errorrZmaybe_b64decodeZuserdata_rawZ
metadata_fullrrZvendordata_raw�get_instance_id�RuntimeError)rZ
on_hetzner�serialZmdZud�er"r"r#�	_get_data4s@

	zDataSourceHetzner._get_datacCstj|j�d�S)Nzsystem-serial-number)rZinstance_id_matches_system_uuidr))rr r"r"r#�check_instance_idmsz#DataSourceHetzner.check_instance_idcCsT|jdkr tjdtj�tj|_|jtjkr2|jS|jd}|sHtd��||_|jS)z�Configure the networking. This needs to be done each boot, since
        the IP information may have changed due to snapshot and/or
        migration.
        Nz5Found None as cached _network_config. Resetting to %sznetwork-configz'Unable to get meta-data from server....)rr'Zwarningrrrr*)rZ_net_configr"r"r#�network_configrs

z DataSourceHetzner.network_configN)	�__name__�
__module__�__qualname__Zdsnamerr-r.�propertyr/r"r"r"r#rs
9rcCsBtjd�}|dkrdStjd�}|r2tjd|�ntd��d|fS)	Nzsystem-manufacturerr
Fzsystem-serial-numberz#Running on Hetzner Cloud: serial=%sz+Hetzner Cloud detected, but no serial foundT)FN)rZ
read_dmi_datar'�debugr*)Zvendor_namer+r"r"r#r$�s

r$cCstj|t�S)N)rZlist_from_depends�datasources)Zdependsr"r"r#�get_datasource_list�sr6)�__doc__ZloggingZ!cloudinit.sources.helpers.hetznerrZhelpersZhetznerr&Z	cloudinitrrrZcloudinit.net.dhcprZcloudinit.net.ephemeralrZ	getLoggerr0r'r%rrrrrrr$ZDEP_FILESYSTEMr5r6r"r"r"r#�<module>s 
n

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