�
܍~c � � � d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dl
mZmZ ej
e� � Z G d� d ej � � ZeZeej ffgZd
� ZdS )� N)� b64decode)�dmi)�log)�sources)�DataSourceHostname)�SERIAL_PORT�Cepkoc �B � e Zd ZdZdZd� Zd� Zd� Zd� Zdd�Z d � Z
d
� 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 �~ � t � � | _ d| _ t j � | |||� � d S )N� )r �cepko�ssh_public_keyr �
DataSource�__init__)�self�sys_cfg�distro�pathss �H/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceCloudSigma.pyr zDataSourceCloudSigma.__init__ s8 � ��W�W��
� �����#�#�D�'�6�5�A�A�A�A�A� c � � t � d� � t j 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)r �sys_product_names r �is_running_in_cloudsigmaz-DataSourceCloudSigma.is_running_in_cloudsigma" |