܍~cddlZddlmZddlmZddlmZddlmZddlm Z ddl m Z m Z ej eZGdd ejZeZeejffgZd ZdS) N) b64decode)dmi)log)sources)DataSourceHostname) SERIAL_PORTCepkocBeZdZdZdZdZdZdZdZd dZ d Z d Z d S) 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~t|_d|_tj||||dS)N)r cepkossh_public_keyr DataSource__init__)selfsys_cfgdistropathss H/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceCloudSigma.pyrzDataSourceCloudSigma.__init__s8WW  ##D'65AAAAActdtjd}|stddStd|d|vS)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)LOGdebugr read_dmi_datalower)rsys_product_names ris_running_in_cloudsigmaz-DataSourceCloudSigma.is_running_in_cloudsigma"sw DEEE,-BCC  IIE F F F5 -/?@@@/557777rcd}|sdS |jj}|d}n+#t$rt dYdSwxYw||dg|_ |tj krdS|dd d}|d d|_ d |vrt|j |_ d |d ivr|d d |_||_|d |_d S)zj Metadata is the whole server context and /meta/cloud-config is used as userdata. NFmetaz+CloudSigma: Unable to read from serial portzcloudinit-dsmode base64_fieldsr,zcloudinit-user-data cloudinit vendor_datarT)r rallresult Exceptionrr_determine_dsmodegetdsmoderDSMODE_DISABLEDsplit userdata_rawrvendordata_rawmetadatar)rr,server_context server_metar#s r _get_datazDataSourceCloudSigma._get_data0s\ ,,.. 5 !Z^^--4N(0KK    IIC D D D55   ,, __/ 0 0 1    W, , ,5#<<BB3GG 'OO,A2FF M 1 1 )$*; < rZs $$$$$$000000CCCCCCCCg!!T%T%T%T%T%7-T%T%T%p/ G245 ;;;;;r