3 \�me(# � @ s^ d dl Z d dlmZmZmZmZmZmZ d dlm Z e j e�ZdZ dZdZdZdZd ZG d d� dej�ZeejejffgZdd � Ze eeeefdd�Ze eeeefdd�Zedk�rZd dlZejdd�Zejddde d� ejddded� ejddeded� ejd ded!ed� ejd"d#ed$ed� ej � Z!ee!j"e!j#e!j$e!j%e!j&d%�Z'e(ej)e'�� dS )&� N)� atomic_helper�dmi�helpers�sources� url_helper�util)�ec2zhttp://169.254.169.254z1.0i� � � �Exoscalec sX e Zd ZdZdZ� fdd�Zdd� Zdd� Zd d � Zdd� Z d d� Z edd� �Z� Z S )�DataSourceExoscaler �x c s| t t| �j|||� tjd� | jjdt�| _| jjdt �| _ t| jjdt��| _ | jjdt�| _| jjdt�| _i | _d S )Nz$Initializing the Exoscale datasource�metadata_url�api_version�password_server_port�timeout�retries)�superr �__init__�LOG�debugZds_cfg�get�METADATA_URLr �API_VERSIONr �int�PASSWORD_SERVER_PORTr �URL_TIMEOUT�url_timeout�URL_RETRIES�url_retries�extra_config)�selfZsys_cfgZdistro�paths)� __class__� �(/usr/lib/python3.6/DataSourceExoscale.pyr s zDataSourceExoscale.__init__c C s8 d}| j jd�}tj|�}|jd| d�r4tjd� dS )z<Adjust set_passwords module to run 'always' during each bootZ set_passwordsZsemZconfig_Nz5Overriding module set_passwords with frequency always)r"