/usr/lib/python3/dist-packages/cloudinit/sources/__pycache__
Edit: /usr/lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceCloudSigma.cpython-310.pyc (3792B)
o
ƒtÖht ã @ s‚ d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl m
Z
mZ e e
¡ZG dd„ dejƒZeZeejffgZdd „ ZdS )
é N)Ú b64decode)ÚdmiÚsources)ÚDataSourceHostname)ÚSERIAL_PORTÚCepkoc @ sR e Zd ZdZdZdd„ Zedd„ ƒZdd„ Zd d
„ Z ddd
„Z
dd„ Zdd„ 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
Ú
CloudSigmac C s$ t ƒ | _d| _tj | |||¡ d S )NÚ )r ÚcepkoÚssh_public_keyr Ú
DataSourceÚ__init__)ÚselfÚsys_cfgÚdistroÚpaths© r úH/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceCloudSigma.pyr s zDataSourceCloudSigma.__init__c C s> t d¡ t d¡} | st d¡ dS t d| ¡ d| ¡ v S )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 %sÚ
cloudsigma)ÚLOGÚdebugr Ú
read_dmi_dataÚlower)Úsys_product_namer r r Ú ds_detect! s
zDataSourceCloudSigma.ds_detectc C sÄ d}z| j ¡ j}|d }W n ty t d¡ Y dS w | | d¡g¡| _|t j
kr/dS | dd¡ d¡}| d d¡| _d |v rIt
| jƒ| _d
| di ¡v rX|d d
| _|| _|d | _d
S )zj
Metadata is the whole server context and /meta/cloud-config is used
as userdata.
NÚmetaz+CloudSigma: Unable to read from serial portFzcloudinit-dsmodeÚ
base64_fieldsr
ú,zcloudinit-user-dataÚ cloudinitÚvendor_datar T)r ÚallÚresultÚ Exceptionr r Ú_determine_dsmodeÚgetÚdsmoder ÚDSMODE_DISABLEDÚsplitÚuserdata_rawr Úvendordata_rawÚmetadatar )r r&