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 :  /usr/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 : /usr/lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceExoscale.cpython-310.pyc
o

x[h~"�@s`ddlZddlmZmZmZmZmZmZddlm	Z	e�
e�ZdZ
dZdZdZdZd	ZGd
d�dej�ZeejejffgZdd
�Ze
eeeefdd�Ze
eeeefdd�Zedkr�ddlZejdd�Zejddde
d�ejddded�ejddeded�ejd ded!ed�ejd"d#ed$ed�e� �Z!ee!j"e!j#e!j$e!j%e!j&d%�Z'e(e�)e'��dSdS)&�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|��|||�t�d�|j�dt�|_|j�dt	�|_
t|j�dt��|_
|j�dt�|_|j�dt�|_i|_dS)Nz$Initializing the Exoscale datasource�metadata_url�api_version�password_server_port�timeout�retries)�superr�__init__�LOG�debug�ds_cfg�get�METADATA_URLr�API_VERSIONr�int�PASSWORD_SERVER_PORTr�URL_TIMEOUT�url_timeout�URL_RETRIES�url_retries�extra_config)�self�sys_cfg�distro�paths��	__class__��F/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceExoscale.pyrs
�
zDataSourceExoscale.__init__cCs<d}|j�d�}t�|�}|�d|d�rt�d�dSdS)z<Adjust set_passwords module to run 'always' during each boot�
set_passwords�sem�config_Nz5Overriding module set_passwords with frequency always)r%�
get_ipath_curr�FileSemaphores�clearrr)r"�cfg�is_new_instance�mod�sem_path�
sem_helperr(r(r)�activate*s	
�zDataSourceExoscale.activatecCs6d�|j|j�}tj|g|j|jtjd�\}}t	|�S)z.Wait for the metadata service to be reachable.z{}/{}/meta-data/instance-id)�urls�max_waitr�	status_cb)
�formatrrr�wait_for_url�url_max_waitrr�critical�bool)r"r�url�	_responser(r(r)�wait_for_metadata_service9s�
�z,DataSourceExoscale.wait_for_metadata_servicecCs4|��}|s
t�d�iSt|j|j|j|j|j�S)zw
        Crawl the metadata service when available.

        @returns: Dictionary of crawled metadata content.
        z,Unable to get response from metadata service)	r@r�error�
read_metadatarrrrr )r"�metadata_readyr(r(r)�crawl_metadataIs
�z!DataSourceExoscale.crawl_metadatacCs\|��}|sdS|d|_|d|_|�d�}i}|r#d|ddid�}t�|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.
        F�	user-data�	meta-data�passwordT�expire)�
ssh_pwauthrG�chpasswd)rD�userdata_raw�metadatarr�
mergemanydictr!)r"�datarG�password_configr(r(r)�	_get_data]s"


��	�zDataSourceExoscale._get_datacCs|jS�N)r!)r"r(r(r)�get_config_obj�sz!DataSourceExoscale.get_config_objcCst�d��t�S)Nzsystem-product-name)r�
read_dmi_data�
startswith�EXOSCALE_DMI_NAMEr(r(r(r)�	ds_detect�s
�zDataSourceExoscale.ds_detect)�__name__�
__module__�__qualname__�dsnamer;rr5r@rDrPrR�staticmethodrV�
__classcell__r(r(r&r)rs
'rcCst�|t�SrQ)r�list_from_depends�datasources)�dependsr(r(r)�get_datasource_list�sr`cCsZd�|||�}tj|dddi||d�}|j�d�}|dvrdStj|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	{}:{}/{}/N�DomU_Request�send_my_password)�ssl_details�headersrrzutf-8)��saved_passwordrf)r9r�read_file_or_url�contents�decode)rrrrr �password_url�responserGr(r(r)�get_password�s*���rlc
Cs�i}||d<ztj||||d�|d<tj||||d�|d<Wnty:}zt�td||�iWYd}~Sd}~wwzt|||||d�|d<W|Stye}zt�td	|||�WYd}~|Sd}~ww)
z8Query the metadata server and return the retrieved data.�_metadata_api_version)rrrErFz(failed reading from metadata url %s (%s)N)rrrr rrGz2failed to read from password server url %s:%s (%s))r�get_instance_userdata�get_instance_metadata�	Exceptionr�logexcrrl)rrrrr �crawled_metadata�er(r(r)rB�sH
����������rB�__main__zQuery Exoscale Metadata)�descriptionz
--endpoint�URLz The url of the metadata service.)�metavar�help�defaultz	--version�VERSIONz.The version of the metadata endpoint to query.z	--retries�NUMz,The number of retries querying the endpoint.)rw�typerxryz	--timeoutz.The time in seconds to wait before timing out.z--password-port�PORTz/The port on which the password endpoint listens)rrrrr )*�logging�	cloudinitrrrrrr�cloudinit.sources.helpersr�	getLoggerrWrrrrrrrU�
DataSourcer�DEP_FILESYSTEM�DEP_NETWORKr^r`rlrB�argparse�ArgumentParser�parser�add_argumentr�
parse_args�args�endpoint�version�
password_portrrrN�print�
json_dumpsr(r(r(r)�<module>s� 
y�
�'
�+�������

Anon7 - 2022
AnonSec Team