404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.117.151.127: ~ $
3

\�me(#�@s^ddlZddlmZmZmZmZmZmZddlm	Z	ej
e�ZdZ
dZdZdZdZd	ZGd
d�dej�ZeejejffgZdd
�Ze
eeeefdd�Ze
eeeefdd�Zedk�rZddlZejdd�Zejddde
d�ejddded�ejddeded�ejd ded!ed�ejd"d#ed$ed�ej �Z!ee!j"e!j#e!j$e!j%e!j&d%�Z'e(ej)e'��dS)&�N)�
atomic_helper�dmi�helpers�sources�
url_helper�util)�ec2zhttp://169.254.169.254z1.0i��
��ExoscalecsXeZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
edd��Z�Z
S)�DataSourceExoscaler�xcs|tt|�j|||�tjd�|jjdt�|_|jjdt	�|_
t|jjdt��|_
|jjdt�|_|jjdt�|_i|_dS)Nz$Initializing the Exoscale datasource�metadata_url�api_version�password_server_port�timeout�retries)�superr�__init__�LOG�debugZds_cfg�get�METADATA_URLr�API_VERSIONr�int�PASSWORD_SERVER_PORTr�URL_TIMEOUT�url_timeout�URL_RETRIES�url_retries�extra_config)�selfZsys_cfgZdistro�paths)�	__class__��(/usr/lib/python3.6/DataSourceExoscale.pyrs
zDataSourceExoscale.__init__cCs8d}|jjd�}tj|�}|jd|d�r4tjd�dS)z<Adjust set_passwords module to run 'always' during each bootZ
set_passwordsZsemZconfig_Nz5Overriding module set_passwords with frequency always)r"Z
get_ipath_currZFileSemaphores�clearrr)r!ZcfgZis_new_instance�modZsem_pathZ
sem_helperr$r$r%�activate*s
	
zDataSourceExoscale.activatecCs6dj|j|j�}tj|g|j|jtjd�\}}t	|�S)z.Wait for the metadata service to be reachable.z{}/{}/meta-data/instance-id)ZurlsZmax_waitrZ	status_cb)
�formatrrrZwait_for_url�url_max_waitrrZcritical�bool)r!rZurlZ	_responser$r$r%�wait_for_metadata_service9sz,DataSourceExoscale.wait_for_metadata_servicecCs6tjtjd|jd�}|siSt|j|j|j|j	|j
�S)zw
        Crawl the metadata service when available.

        @returns: Dictionary of crawled metadata content.
        z waiting for the metadata service)�logfunc�msg�func)r�log_timer�infor,�
read_metadatarrrrr)r!Zmetadata_readyr$r$r%�crawl_metadataIs
z!DataSourceExoscale.crawl_metadatacCshtjtjd|jd�}|sdS|d|_|d|_|jd�}i}|rRd|ddid	�}tj|j	|g�|_	dS)
z�Fetch the user data, the metadata and the VM password
        from the metadata service.

        Please refer to the datasource documentation for details on how the
        metadata server and password server are crawled.
        zCrawl of metadata service)r-r.r/Fz	user-dataz	meta-data�passwordTZexpire)Z
ssh_pwauthr4Zchpasswd)
rr0rrr3Zuserdata_rawZmetadatarZ
mergemanydictr )r!�datar4Zpassword_configr$r$r%�	_get_data`s"



zDataSourceExoscale._get_datacCs|jS)N)r )r!r$r$r%�get_config_obj�sz!DataSourceExoscale.get_config_objcCstjd�jt�S)Nzsystem-product-name)rZ
read_dmi_data�
startswith�EXOSCALE_DMI_NAMEr$r$r$r%�	ds_detect�s
zDataSourceExoscale.ds_detect)�__name__�
__module__�__qualname__Zdsnamer*rr(r,r3r6r7�staticmethodr:�
__classcell__r$r$)r#r%rs
+rcCstj|t�S)N)rZlist_from_depends�datasources)Zdependsr$r$r%�get_datasource_list�srAcCsZdj|||�}tj|dddi||d�}|jjd�}|d	kr>dStj|dddi||d�|S)
z�Obtain the VM's password if set.

    Once fetched the password is marked saved. Future calls to this method may
    return empty string or 'saved_password'.z	{}:{}/{}/NZDomU_RequestZsend_my_password)Zssl_detailsZheadersrrzutf-8��saved_password)rBrC)r)rZread_file_or_url�contents�decode)rrrrrZpassword_urlZresponser4r$r$r%�get_password�s$
rFc Cs�i}||d<y0tj||||d�|d<tj||||d�|d<Wn0tk
rl}ztjtd||�iSd}~XnXyt|||||d�|d<Wn4tk
r�}ztjtd	|||�WYdd}~XnX|S)
z8Query the metadata server and return the retrieved data.Z_metadata_api_version)rrz	user-dataz	meta-dataz(failed reading from metadata url %s (%s)N)rrrrrr4z2failed to read from password server url %s:%s (%s))rZget_instance_userdataZget_instance_metadata�	ExceptionrZlogexcrrF)rrrrrZcrawled_metadata�er$r$r%r2�s4r2�__main__zQuery Exoscale Metadata)�descriptionz
--endpointZURLz The url of the metadata service.)�metavar�help�defaultz	--version�VERSIONz.The version of the metadata endpoint to query.z	--retriesZNUMz,The number of retries querying the endpoint.)rK�typerLrMz	--timeoutz.The time in seconds to wait before timing out.z--password-portZPORTz/The port on which the password endpoint listens)rrrrr)*ZloggingZ	cloudinitrrrrrrZcloudinit.sources.helpersrZ	getLoggerr;rrrrrrr9Z
DataSourcerZDEP_FILESYSTEMZDEP_NETWORKr@rArFr2�argparse�ArgumentParser�parser�add_argumentr�
parse_args�argsZendpoint�versionZ
password_portrrr5�printZ
json_dumpsr$r$r$r%�<module>s| 
"&



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