404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.76.250: ~ $
3

\�meT)�@sddlZddlZddlmZmZmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZeje�Zdd	gZd
ZdeiZdZd
ZeegZdZdZdZeZeeeeg7ZGdd�dej ej!�Z"Gdd�de"�Z#ddd�Z$e#ej%ffe"ej%ej&ffgZ'dd�Z(dS)�N)�dmi�sources�
url_helper�util)�
EventScope�	EventType)�NoDHCPLeaseError)�EphemeralDHCPv4)�DataSourceOracle)�	openstackzhttp://[fe80::a9fe:a9fe]zhttp://169.254.169.254ziid-dsopenstackzinstance-idzOpenStack NovazOpenStack ComputeZOpenTelekomCloudz
SAP CCloud VMZHUAWEICLOUDcs�eZdZdZejZdZej	e
je
je
j
e
jhiZ�fdd�Zdd�Zdd�Zd	d
�Zedd��Zd
d�Zdd�Zdd�Z�ZS)�DataSourceOpenStackZ	OpenStackFcsHtt|�j|||�d|_tj|j�|_d|_i|_	t
j|_t
j|_
dS)N)�superr�__init__�metadata_addressrZfetch_ssl_details�paths�ssl_details�version�filesr�UNSET�ec2_metadata�network_json)�self�sys_cfg�distror)�	__class__��)/usr/lib/python3.6/DataSourceOpenStack.pyr=szDataSourceOpenStack.__init__cCs"tjj|�}d||j|jf}|S)Nz%s [%s,ver=%s])r�
DataSource�__str__�dsmoder)r�rootZmstrrrrrFszDataSourceOpenStack.__str__cCs|jjdt�}dd�|D�}t|�t|�krHtjdtt|�t|���t|�rV|}ntjd�t}g}i}x*|D]"}t	j
|d�}|j|�|||<qrW|j�}t
j
�}t	j||j|jdd�\}	}
|	r�tjd	||	�ntjd
|tt
j
�|��|j|	�|_t|	�S)NZ
metadata_urlscSsg|]}tj|�r|�qSr)rZis_resolvable_url)�.0�xrrr�
<listcomp>MszADataSourceOpenStack.wait_for_metadata_service.<locals>.<listcomp>z,Removed the following from metadata urls: %sz+Empty metadata url list! using default listrF)�urlsZmax_wait�timeoutZconnect_synchronouslyzUsing metadata source: '%s'z2Giving up on OpenStack md from %s after %s seconds)�ds_cfg�get�DEF_MD_URLS�set�LOG�debug�list�len�warningrZcombine_url�append�get_url_params�timeZwait_for_urlZmax_wait_seconds�timeout_seconds�intr�bool)rr$ZfilteredZmd_urlsZurl2baseZurlZmd_url�
url_paramsZ
start_timeZ	avail_urlZ	_responserrr�wait_for_metadata_serviceKs>


z-DataSourceOpenStack.wait_for_metadata_servicecCstj|j��S)N)rZinstance_id_matches_system_uuidZget_instance_id)rrrrr�check_instance_idtsz%DataSourceOpenStack.check_instance_idcCsn|jtjkr|jStj|jjdd��r2d|_|jS|jtjkrLtj	d�dStj
d�tj|jdd�|_|jS)z@Return a network config dict for rendering ENI or netplan files.Zapply_network_configTNz<Unexpected call to network_config when network_json is None.z(network config provided via network_json)Z
known_macs)
�_network_configrrrZis_falser&r'rr*r.r+rZconvert_net_json)rrrr�network_configxs
z"DataSourceOpenStack.network_configc,Cs�|jrry2t|j|j��tjtjd|jd�}WdQRXWq�t	t
jfk
rn}ztjtt
|��dSd}~Xq�Xn@y|j�}Wn2t
jk
r�}ztjtt
|��dSd}~XnX|j|jd�g�|_|jt
jkr�dS|jdi�}tj|tg�}||_|jd�|_|jd�|_|jd	�|_|d
|_|jj|jdi��|jd�}||_yt
j|�|_Wn6tk
�r�}ztjd
|�d|_WYdd}~XnX|jd�}||_ yt
j|�|_!Wn6tk
�r�}ztjd|�d|_!WYdd}~XnXdS)a
Crawl metadata, parse and persist that data for this instance.

        @return: True when metadata discovered indicates OpenStack datasource.
            False when unable to contact metadata service or when metadata
            format is invalid or disabled.
        zCrawl of metadata service)Zlogfunc�msg�funcNFr�metadatazec2-metadataZnetworkdataZuserdatarrZ
vendordataz"Invalid content in vendor-data: %sZvendordata2z#Invalid content in vendor-data2: %sT)"�perform_dhcp_setupr	rZfallback_interfacer�log_timer*r+�_crawl_metadatarr�InvalidMetaDataExceptionZlogexc�strZ_determine_dsmoder'rZDSMODE_DISABLEDZ
mergemanydict�DEFAULT_METADATAr<rrZuserdata_rawrr�updateZvendordata_pureZconvert_vendordataZvendordata_raw�
ValueErrorr.Zvendordata2_pureZvendordata2_raw)r�results�eZmdZvdZvd2rrr�	_get_data�sR


zDataSourceOpenStack._get_datacCs�y|j�stjd��Wn8tk
rN}ztjdjt|�d���WYdd}~XnX|j�}y,tjt	j
dt|jg|j
|j|jd�d�}Wnrtjk
r�}ztjt|���WYdd}~XnBtjtfk
r�}z dj|jd	�}tj|�|�WYdd}~XnX|S)
z�Crawl metadata service when available.

        @returns: Dictionary with all metadata discovered for this datasource.
        @raise: InvalidMetaDataException on unreadable or broken
            metadata.
        z No active metadata service foundz,IOError contacting metadata service: {error})�errorNz#Crawl of openstack metadata service)r�retriesr%)�args�kwargszBroken metadata address {addr})Zaddr)r6rr@�IOError�formatrAr0rr>r*r+�read_metadata_servicerrZnum_retriesr2rZNonReadableZBrokenMetadata)rrFr5�resultr:rrrr?�s2
 
z#DataSourceOpenStack._crawl_metadatacCspd|jjd�k}tj�sdStjd�}|tkr2dStjd�tkrDdS|rTtj	�rTdStj
d�jd�tkrldSdS)	z<Return True when a potential OpenStack platform is detected.ZOracleZdatasource_listTzsystem-product-namezchassis-asset-tag��product_nameF)rr'rZis_x86rZ
read_dmi_data�VALID_DMI_PRODUCT_NAMES�VALID_DMI_ASSET_TAGS�oracleZ_is_platform_viableZget_proc_env�DMI_PRODUCT_NOVA)rZ
accept_oraclerQrrr�	ds_detect�s
zDataSourceOpenStack.ds_detect)�__name__�
__module__�__qualname__Zdsnamerrr8r=rZNETWORKrZBOOT_NEW_INSTANCEZBOOTZBOOT_LEGACYZHOTPLUGZsupported_update_eventsrrr6r7�propertyr9rGr?rV�
__classcell__rr)rrr+s 
	)9*rc@seZdZdZdZdS)�DataSourceOpenStackLocalauRun in init-local using a dhcp discovery prior to metadata crawl.

    In init-local, no network is available. This subclass sets up minimal
    networking with dhclient on a viable nic so that it can talk to the
    metadata service. If the metadata service provides network configuration
    then render the network configuration for that instance based on metadata.
    TN)rWrXrY�__doc__r=rrrrr\sr\�cCstj||||d�}|j�S)N)rr%rI)rZMetadataReaderZread_v2)Zbase_urlrr%rI�readerrrrrNsrNcCstj|t�S)N)rZlist_from_depends�datasources)Zdependsrrr�get_datasource_list"sra)Nr^r^))Zloggingr1Z	cloudinitrrrrZcloudinit.eventrrZcloudinit.net.dhcprZcloudinit.net.ephemeralr	Zcloudinit.sourcesr
rTZcloudinit.sources.helpersrZ	getLoggerrWr*r(ZDEFAULT_IIDrBrUZDMI_PRODUCT_COMPUTErRZDMI_ASSET_TAG_OPENTELEKOMZDMI_ASSET_TAG_SAPCCLOUDZDMI_ASSET_TAG_HUAWEICLOUDrSZSourceMixinrrr\rNZDEP_FILESYSTEMZDEP_NETWORKr`rarrrr�<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