404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.22.249.135: ~ $
3

\�me�3�@s�ddlZddlZddlZddlmZmZmZddlmZej	e
�ZGdd�dej�Z
ddd�Zddd	�Zdd
d�Zdd
�ZGdd�de
�Ze
ejffeejejffgZdd�ZdS)�N)�dmi�sources�util)�enic@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dd
�Z
dd�Zdd�Zedd��Z
dS)�DataSourceNoCloudZNoCloudcCsJtjj||||�d|_tjj|jd�tjj|jd�g|_d|_d|_	dS)N�nocloudznocloud-net�/�file://)rr	)
r�
DataSource�__init__�seed�os�path�join�seed_dir�	seed_dirs�supported_seed_starts)�self�sys_cfg�distro�paths�r�'/usr/lib/python3.6/DataSourceNoCloud.pyrszDataSourceNoCloud.__init__cCstjj|�}d||j|jfS)Nz%s [seed=%s][dsmode=%s])rr
�__str__r�dsmode)r�rootrrrr#szDataSourceNoCloud.__str__cCs|tjd�}|jtjd��tjd|j��}|jtjd|j���|jtjd|��tt|�t|�@�}|jdd�|S)Nz	TYPE=vfatzTYPE=iso9660zLABEL=%szLABEL_FATBOOT=%sT)�reverse)rZfind_devs_with�extend�upper�lower�list�set�sort)r�labelZfslistZ
label_listZdevlistrrr�_get_devices's
zDataSourceNoCloud._get_devicesc"Cs�d|jd�}g}idddd�}y8i}tjd�}|rTt||�rT|jd�t|d|i�}Wn tk
rvtjt	d�d	SXy(i}t|�r�|jd
�t|d|i�}Wn tk
r�tjt	d�d	SXddgd
dgd�}xZ|j
D]P}y4tj|f|�}|j|�t	jd|�t||�}PWq�t
k
�r*Yq�Xq�W|jjd��rZ|jd�|jd|dd<d|jk�r�d|jk�r�t||j�}|jd�dd�}	|jjdd�}
|
dk	�r�x�|j|
�D]�}ynt	jd|�ytj||	|�}Wn(t
k
�rt	jd||
��w�YnXt||�}t	jd|�|j|�PWnXtk
�rZ}z|jtjk�rJ�WYdd}~Xn&tjk
�r~tjt	d|�YnX�q�Wt|�dk�r�d	Sd|dk�rL|dd}
d	}x"|jD]}|
j|��r�|}P�q�W|�s�t	jd|
|�d	Stj|
�}
tj|
dd�\}}}t	jd|
�tj|d|g�|d<||d<||d
<|j|
�tj|d|g�|d<|j|djd �g�|_|jtjk�r�t	jd!||j�d	Sd"j |�|_!|d|_"|d|_#|d
|_$|d|_%|djd#�|_&d$S)%Nr)zinstance-idr�)z	meta-dataz	user-datazvendor-dataznetwork-configzsystem-serial-numberrz	meta-datazUnable to parse dmi dataF�cmdlinez!Unable to parse command line dataz	user-datazvendor-dataznetwork-config)�requiredZoptionalzUsing seeded data from %s�seedfromZds_config_seedfromZ	ds_configcSstj|f|�S)N)r�pathprefix2dict)Zmp�datarrr�_pp2d_callbacktsz3DataSourceNoCloud._get_data.<locals>._pp2d_callbackZfs_labelZcidatazAttempting to use data from %sz)device %s with label=%s not a valid seed.zUsing data from %sz(Failed to mount %s when looking for datarz Seed from %s not supported by %s)ZtimeoutzUsing seeded cache data from %srz&%s: not claiming datasource, dsmode=%s�,znetwork-interfacesT)'rrZ
read_dmi_data�load_cmdline_data�append�_merge_new_seed�	ExceptionrZlogexc�LOGrr)�debug�
ValueErrorZds_cfg�getr$Zmount_cbZwarning�OSError�errno�ENOENTZMountFailedError�lenr�
startswithZsub_dmi_varsZread_seeded�
mergemanydictZ_determine_dsmoderZDSMODE_DISABLEDrrZmetadataZuserdata_rawZvendordata_raw�_network_config�_network_eni)rZdefaults�foundZmydata�md�serialZpp2d_kwargsr�seededr+r#Zdev�er(Z	seedfound�protoZmd_seedZudZvdrrr�	_get_data3s�


















zDataSourceNoCloud._get_datacCs.t|d�sd|_|js(tj�r"dnd|_|jS)N�_platform_typeZlxdr)�hasattrrDrZis_lxd)rrrr�
platform_type�s

zDataSourceNoCloud.platform_typecCstjS)z=Return unknown when 'cloud-name' key is absent from metadata.)rZMETADATA_UNKNOWN)rrrr�_get_cloud_name�sz!DataSourceNoCloud._get_cloud_namecCs$|jjd�rd}nd}d||jfS)z/Return the subplatform metadata source details.z/devzconfig-diskzseed-dirz%s (%s))rr9)rZsubplatform_typerrr�_get_subplatform�sz"DataSourceNoCloud._get_subplatformcCs:|j�}|sdSt|d|jg�}t|d�}|s2dS||kS)Nr)�dirs)Zget_instance_id�getattrr�_quick_read_instance_id)rrZcurrentrIZquick_idrrr�check_instance_id�s
z#DataSourceNoCloud.check_instance_idcCs(|jdkr"|jdk	r"tj|j�|_|jS)N)r;r<rZconvert_eni_data)rrrr�network_config�s

z DataSourceNoCloud.network_configN)�__name__�
__module__�__qualname__Zdsnamerrr$rC�propertyrFrGrHrLrMrrrrrs
	rcCs�|dkrg}d}i}t|�r,||kr,||Sxb|D]Z}|dkr@q2y6tj|dgd�}tj|d�}|rt||krt||SWq2tk
r�Yq2Xq2WdS)Nzinstance-idz	meta-data)r')r-rr)�	load_yamlr3)rIZiid_key�fill�dr*r>rrrrK�s"

rKcCs�dtjfdtjfg}xn|D]f\}}t|||�s0qd|kr<dS|jd�}|rv|jd�r`tj|d<q~|jd�r~tj|d<n||d<dSWd
S)
Nz
ds=nocloudzds=nocloud-netrTr(�http://�https://�file://rF)rUrV)rWr)rZDSMODE_LOCALZDSMODE_NETWORK�parse_cmdline_datar4r9)rSr&ZpairsZidstrrr(rrrr-s 


r-cCs�|dkrtj�}d|}d||kp.d||ks4dSd}x&|j�D]}|j|�rB|jdd�}qBW|djd�}t|�dkr�|dd�}nf}dd	d
d�}x`|D]X}|dkr�q�y|jdd�\}	}
Wntk
r�|}	d}
YnX|	|kr�||	}	|
||	<q�WdS)
Nz %s z %s;Fr%�=��;zlocal-hostnamezinstance-idr()�h�i�sT)rZget_cmdline�splitr9r8r0)Zds_idrSr&Zargline�tokZtmpZkvpairsZs2l�item�k�vrrrrX3s4


rXcCs�|j�}|jdi�}t|dt�s0tj|d�}tj|d|g�|d<|jd�rdtj|jd��|d<d|krx|d|d<d|kr�|d|d<|S)Nz	meta-dataznetwork-configz	user-datazvendor-data)�copyr4�
isinstance�dictrrRr:)Zcurr@�retZnewmdrrrr/[s
r/c@seZdZdd�Zdd�ZdS)�DataSourceNoCloudNetcCstj||||�d|_dS)N�http://�https://)rirj)rrr)rrrrrrrrnszDataSourceNoCloudNet.__init__cCsdtj�kS)aNoCloud requires "nocloud-net" as the way to specify
        seeding from an http(s) address. This diverges from all other
        datasources in that it does a kernel commandline match on something
        other than the datasource dsname for only DEP_NETWORK.
        znocloud-net)rZ
parse_cmdline)rrrr�	ds_detectrszDataSourceNoCloudNet.ds_detectN)rNrOrPrrkrrrrrhmsrhcCstj|t�S)N)rZlist_from_depends�datasources)Zdependsrrr�get_datasource_list�srm)N)N)N)r6Zloggingr
Z	cloudinitrrrZ
cloudinit.netrZ	getLoggerrNr1r
rrKr-rXr/rhZDEP_FILESYSTEMZDEP_NETWORKrlrmrrrr�<module>s
i


(


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