/usr/lib/python3/dist-packages/cloudinit/sources/__pycache__
NameSizeModeActions
DataSourceAkamai.cpython-310.pyc85290644editdlrm
DataSourceAliYun.cpython-310.pyc121310644editdlrm
DataSourceAltCloud.cpython-310.pyc72320644editdlrm
DataSourceAzure.cpython-310.pyc529630644editdlrm
DataSourceBigstep.cpython-310.pyc19580644editdlrm
DataSourceCloudCIX.cpython-310.pyc47660644editdlrm
DataSourceCloudSigma.cpython-310.pyc37920644editdlrm
DataSourceCloudStack.cpython-310.pyc103020644editdlrm
DataSourceConfigDrive.cpython-310.pyc85910644editdlrm
DataSourceDigitalOcean.cpython-310.pyc38830644editdlrm
DataSourceEc2.cpython-310.pyc286660644editdlrm
DataSourceExoscale.cpython-310.pyc61090644editdlrm
DataSourceGCE.cpython-310.pyc101260644editdlrm
DataSourceHetzner.cpython-310.pyc63390644editdlrm
DataSourceIBMCloud.cpython-310.pyc137660644editdlrm
DataSourceLXD.cpython-310.pyc137980644editdlrm
DataSourceMAAS.cpython-310.pyc119180644editdlrm
DataSourceNoCloud.cpython-310.pyc99850644editdlrm
DataSourceNone.cpython-310.pyc14170644editdlrm
DataSourceNWCS.cpython-310.pyc41470644editdlrm
DataSourceOpenNebula.cpython-310.pyc124340644editdlrm
DataSourceOpenStack.cpython-310.pyc81680644editdlrm
DataSourceOracle.cpython-310.pyc147910644editdlrm
DataSourceOVF.cpython-310.pyc94540644editdlrm
DataSourceRbxCloud.cpython-310.pyc75520644editdlrm
DataSourceScaleway.cpython-310.pyc111630644editdlrm
DataSourceSmartOS.cpython-310.pyc253120644editdlrm
DataSourceUpCloud.cpython-310.pyc45220644editdlrm
DataSourceVMware.cpython-310.pyc284110644editdlrm
DataSourceVultr.cpython-310.pyc36410644editdlrm
DataSourceWSL.cpython-310.pyc115500644editdlrm
__init__.cpython-310.pyc324600644editdlrm
Edit: /usr/lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceAltCloud.cpython-310.pyc (7232B)
o th!@sdZddlZddlZddlZddlZddlmZmZmZm Z e e Z dZ ddgZiddid Zd d ZGd d d ejZddZeejejffgZddZdS)zb This file contains code used to gather the user data passed to an instance on RHEVm and vSphere. N)dmisourcessubputilz/etc/sysconfig/cloud-infomodprobefloppyi localhost)zblock-device-mappingz instance-idzlocal-hostname placementc Csn|d}|d}z t|}W|Sty6z t|}WY|Sty5ttdYYdSww)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)rload_text_filestripIOErrorlogexcLOG) mount_dirdeltacloud_user_data_fileuser_data_file user_datarF/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAltCloud.pyread_user_data_callback&s  rcsbeZdZdZddZdeddffdd Zd d Zd d Zd dZ ddZ ddZ ddZ Z S)DataSourceAltCloudAltCloudcCs*tj||||d|_d|_tj|_dS)N)/zfile://)r DataSource__init__seedsupported_seed_startsMETADATA_UNKNOWNsource)selfsys_cfgdistropathsrrrrLs zDataSourceAltCloud.__init__ci_pkl_versionreturnNcs&t|t|dstj|_dSdS)Nr)super _unpicklehasattrrrr)rr# __class__rrr&Rs   zDataSourceAltCloud._unpicklecCstj|}d||jfS)Nz %s [seed=%s])rr__str__r)rrootrrrr*Ws zDataSourceAltCloud.__str__cCstjtr$z tt}W|Sty#t t dtYdSwt d}|s-dS|}| dr8dS| dr?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.UNKNOWNzsystem-product-nameRHEVVMWAREVSPHERE)ospathexistsCLOUD_INFO_FILErr r upperr r rr read_dmi_data startswith)r cloud_type system_namesys_namerrrget_cloud_type[s,     z!DataSourceAltCloud.get_cloud_typecCsbtd|}tdt|d|vr|rdSn d|vr'|r&dSndSttddS)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: %sr-Tr/FzFailed accessing user data.)rdebugr:struser_data_rhevmuser_data_vsphererr rr7rrr _get_datas  zDataSourceAltCloud._get_datacCs(|}|dkr d|_d||jfS)z(Return the subplatform metadata details.r-/dev/fd0z%s (%s))r:rlowerr?rrr_get_subplatformsz#DataSourceAltCloud._get_subplatformc Csd}ztWntjy"}zttd|WYd}~dSd}~wwd}z tj|ddWntjtfyK}zttd|WYd}~dSd}~wwzt|t }Wn)tym}z |j t j krcWYd}~nd}~wtj y}ttd|Ynw||_ t|_|rd SdS) a RHEVM specific userdata read If on RHEV-M the user data will be contained on the floppy device in file To access it: modprobe floppy Leverage util.mount_cb to: mkdir mount /dev/fd0 The call back passed to util.mount_cb will do: read / NzFailed modprobe: %sFrA)r2timeoutzFailed udevadm_settle: %s -Failed to mount %s when looking for user dataT)modprobe_floppyrProcessExecutionErrorrr rudevadm_settleOSErrormount_cbrerrnoENOENTMountFailedError userdata_rawMETA_DATA_NOT_SUPPORTEDmetadata)r return_stre floppy_deverrrrrr=sF   z"DataSourceAltCloud.user_data_rhevmc Csd}td}|D];}zt|t}|r||_Wn+Wq ty4}z |jtjkr*WYd}~q d}~wtjyDt t d|Yq w||_ t |_ |rOdSdS)a vSphere specific userdata read If on vSphere the user data will be contained on the cdrom device in file To access it: Leverage util.mount_cb to: mkdir mount /dev/fd0 The call back passed to util.mount_cb will do: read / Nz LABEL=CDROMrFTF)rfind_devs_withrKrrrJrLrMrNr rrOrPrQ)rrR cdrom_list cdrom_devrUrrrr>s4    z$DataSourceAltCloud.user_data_vsphere)__name__ __module__ __qualname__dsnamerintr&r*r:r@rCr=r> __classcell__rrr(rrHs+'6rcCs&tt\}}tddt|dS)NzCommand: %s Output%s )rCMD_PROBE_FLOPPYrr;join)out_errrrrrGsrGcCs t|tS)N)rlist_from_depends datasources)dependsrrrget_datasource_list"s rg)__doc__rLloggingr0os.path cloudinitrrrr getLoggerrYrr3r`rPrrrrGDEP_FILESYSTEM DEP_NETWORKrergrrrrs*  "L