- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.145.170.164
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__/DataSourceAltCloud.cpython-36.pyc
3

\�me� �@s�dZddlZddlZddlZddlZddlmZmZmZm	Z	ej
e�ZdZ
ddgZiddid	�Zd
d�ZGdd
�d
ej�Zdd�ZeejejffgZdd�ZdS)zb
This file contains code used to gather the user data passed to an
instance on RHEVm and vSphere.
�N)�dmi�sources�subp�utilz/etc/sysconfig/cloud-infoZmodprobeZfloppyi�Z	localhost)zblock-device-mappingzinstance-idzlocal-hostnameZ	placementcCsp|d}|d}ytj|�j�}WnHtk
rjytj|�j�}Wn tk
rdtjtd�dSXYnX|S)an
    Description:
        This callback will be applied by util.mount_cb() on the mounted
        file.

        Deltacloud file name contains deltacloud. Those not using
        Deltacloud but instead instrumenting the injection, could
        drop deltacloud from the file name.

    Input:
        mount_dir - Mount directory

    Returns:
        User Data

    z/deltacloud-user-data.txtz/user-data.txtz Failed accessing user data file.N)r�	load_file�strip�IOError�logexc�LOG)Z	mount_dirZdeltacloud_user_data_fileZuser_data_fileZ	user_data�r�(/usr/lib/python3.6/DataSourceAltCloud.py�read_user_data_callback&sr
c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�DataSourceAltCloudZAltCloudcCs"tjj||||�d|_d|_dS)N�/�file://)rr)r�
DataSource�__init__�seedZsupported_seed_starts)�selfZsys_cfgZdistro�pathsrrrrLszDataSourceAltCloud.__init__cCstjj|�}d||jfS)Nz%s [seed=%s])rr�__str__r)r�rootrrrrQszDataSourceAltCloud.__str__cCs�tjjt�rJytjt�j�j�}Wn"tk
rDtj	t
dt�dSX|Stjd�}|s\dS|j�}|j
d�rrdS|j
d�r�dSdS)at
        Description:
            Get the type for the cloud back end this instance is running on
            by examining the string returned by reading either:
                CLOUD_INFO_FILE or
                the dmi data.

        Input:
            None

        Returns:
            One of the following strings:
            'RHEV', 'VSPHERE' or 'UNKNOWN'

        z'Unable to access cloud info file at %s.ZUNKNOWNzsystem-product-name�RHEVZVMWARE�VSPHERE)�os�path�exists�CLOUD_INFO_FILErrr�upperrr	r
rZ
read_dmi_data�
startswith)r�
cloud_typeZsystem_nameZsys_namerrr�get_cloud_typeUs&


z!DataSourceAltCloud.get_cloud_typecCsbtjd�|j�}tjdt|��d|kr8|j�rRdSnd|krN|j�rRdSndStjtd�dS)a�
        Description:
            User Data is passed to the launching instance which
            is used to perform instance configuration.

            Cloud providers expose the user data differently.
            It is necessary to determine which cloud provider
            the current instance is running on to determine
            how to access the user data. Images built with
            image factory will contain a CLOUD_INFO_FILE which
            contains a string identifying the cloud provider.

            Images not built with Imagefactory will try to
            determine what the cloud provider is based on system
            information.
        zInvoked get_data()zcloud_type: %srTrFzFailed accessing user data.)r
�debugr!�str�user_data_rhevm�user_data_vsphererr	)rr rrr�	_get_data~s
zDataSourceAltCloud._get_datacCs:|j�}t|d�stj|_|dkr(d|_d|j�|jfS)z(Return the subplatform metadata details.�sourcerz/dev/fd0z%s (%s))r!�hasattrrZMETADATA_UNKNOWNr'�lower)rr rrr�_get_subplatform�s
z#DataSourceAltCloud._get_subplatformc,Csd}y
t�Wn0tjk
r>}ztjtd|�dSd}~XnXd}ytj|dd�Wn4tjtfk
r�}ztjtd|�dSd}~XnXytj|t	�}WnRtk
r�}z|j
t
jkr��WYdd}~Xn$tjk
r�tjtd|�YnX||_
t|_|�rd	SdSdS)
a�
        RHEVM specific userdata read

         If on RHEV-M the user data will be contained on the
         floppy device in file <user_data_file>
         To access it:
           modprobe floppy

           Leverage util.mount_cb to:
               mkdir <tmp mount dir>
               mount /dev/fd0 <tmp mount dir>
               The call back passed to util.mount_cb will do:
                   read <tmp mount dir>/<user_data_file>
        NzFailed modprobe: %sFz/dev/fd0�)rZtimeoutzFailed udevadm_settle: %s
z-Failed to mount %s when looking for user dataT)�modprobe_floppyrZProcessExecutionErrorrr	r
Zudevadm_settle�OSError�mount_cbr
�errno�ENOENT�MountFailedError�userdata_raw�META_DATA_NOT_SUPPORTED�metadata)r�
return_str�eZ
floppy_dev�errrrrr$�s6
z"DataSourceAltCloud.user_data_rhevmcCs�d}tjd�}x||D]t}ytj|t�}|r2||_PWqtk
rd}z|jtjkrT�WYdd}~Xqtjk
r�tj	t
d|�YqXqW||_t|_
|r�dSdSdS)a�
        vSphere specific userdata read

        If on vSphere the user data will be contained on the
        cdrom device in file <user_data_file>
        To access it:
           Leverage util.mount_cb to:
               mkdir <tmp mount dir>
               mount /dev/fd0 <tmp mount dir>
               The call back passed to util.mount_cb will do:
                   read <tmp mount dir>/<user_data_file>
        NzLABEL=CDROMz-Failed to mount %s when looking for user dataTF)rZfind_devs_withr.r
r'r-r/r0r1r	r
r2r3r4)rr5Z
cdrom_listZ	cdrom_devr7rrrr%�s*

z$DataSourceAltCloud.user_data_vsphereN)�__name__�
__module__�__qualname__Zdsnamerrr!r&r*r$r%rrrrrHs)'	6rcCs&tjt�\}}tjddjt�|�dS)NzCommand: %s
Output%s� )r�CMD_PROBE_FLOPPYr
r"�join)�outZ_errrrrr,
sr,cCstj|t�S)N)rZlist_from_depends�datasources)Zdependsrrr�get_datasource_listsr@)�__doc__r/ZloggingrZos.pathZ	cloudinitrrrrZ	getLoggerr8r
rr<r3r
rrr,ZDEP_FILESYSTEMZDEP_NETWORKr?r@rrrr�<module>
s$
"F


Youez - 2016 - github.com/yon3zu
LinuXploit