0x1949 Team - FAZEMRX - MANAGER
Edit File: DataSourceMAAS.cpython-310.pyc
o ���fi; � @ s d dl Z d dlZd dlZd dlZd dlmZmZmZ d dlm Z d dl mZ e�e �ZdZg d�ZG dd� dej�ZG d d � d e�Zdd� Zd d� Zdd� Zddeddfdd�Zdd� ZG dd� de�ZG dd� de�ZeejffeejejffgZdd� Ze dkr�dd� Z e � dS dS )� N)�sources� url_helper�util)�KlibcNetworkConfigSource)�NetworkConfigSourcez 2012-03-01))�meta-data/instance-idr FF)�meta-data/local-hostnamer FF)�meta-data/public-keysr FT)zmeta-data/vendor-data�vendor-dataTT)� user-datar TTc @ sh e Zd ZdZdZdZdZdZdZdd� Z e dd � �Zd d� Zdd � Z dd� Zdd� Zdd� Zdd� ZdS )�DataSourceMAASz� DataSourceMAAS reads instance information from MAAS. Given a config metadata_url, and oauth tokens, it expects to find files under the root named: instance-id user-data hostname vendor-data �MAASN�x �2 c C s: t j�| |||� d | _tj�|jd�| _t| j �| _ d S )N�maas)r � DataSource�__init__�base_url�os�path�join�seed_dir�get_id_from_ds_cfg�ds_cfg�id_hash)�self�sys_cfg�distro�paths� r �B/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceMAAS.pyr 2 s zDataSourceMAAS.__init__c C s | j s t| j�| _ | j S �N)� _oauth_helper�get_oauth_helperr �r r r r �oauth_helper8 s zDataSourceMAAS.oauth_helperc C s t j�| �}d|| jf S )Nz%s [%s])r r �__str__r )r �rootr r r r&