File: //usr/lib/python3/dist-packages/cloudinit/__pycache__/cloud.cpython-39.pyc
a
��`� � @ sF d dl Z d dlZd dlmZ d dlmZ e�e�Z G dd� de
�ZdS )� N)�log)�eventsc @ s� e Zd Zd"dd�Zdd� Zedd� �Zd#d d
�Zdd� Zd$dd�Z dd� Z
edd� �Zdd� Zdd� Z
d%dd�Zdd� Zd&dd�Zd'dd�Zd(d d!�ZdS ))�CloudNc C s@ || _ || _|| _|| _|| _|d u r6tjdddd�}|| _d S )Nzunnamed-cloud-reporterF)�name�description�reporting_enabled)�
datasource�paths�distro�_cfg�_runnersr �ReportEventStack�reporter)�selfr r �cfgr
Zrunnersr � r �1/usr/lib/python3/dist-packages/cloudinit/cloud.py�__init__ s �zCloud.__init__c C s t �� t �| j� d S �N)�logging�resetLogging�setupLoggingr �r r r r �
cycle_logging, s zCloud.cycle_loggingc C s t �| j�S r )�copy�deepcopyr r r r r r 0 s z Cloud.cfgFc C s | j �|||||�S r )r �run)r r �functor�args�freqZ
clear_on_failr r r r 5 s z Cloud.runc C s6 | j j| }tj�|�s2t�dtj�|�|� d S |S )Nz-No template found in %s for template named %s)r Ztemplate_tpl�os�path�isfile�LOG�warning�dirname)r r �fnr r r �get_template_filename8 s �zCloud.get_template_filenameTc C s | j �|�S r )r �get_userdata)r �apply_filterr r r r( A s zCloud.get_userdatac C s
| j �� S r )r �get_instance_idr r r r r* D s zCloud.get_instance_idc C s | j jS r )r �launch_indexr r r r r+ G s zCloud.launch_indexc C s
| j �� S r )r �get_public_ssh_keysr r r r r, K s zCloud.get_public_ssh_keysc C s
| j �� S r )r �
get_localer r r r r- N s zCloud.get_localec C s | j j||d�S )N)�fqdn�
metadata_only)r �get_hostname)r r. r/ r r r r0 Q s �zCloud.get_hostnamec C s | j �|�S r )r �device_name_to_device�r r r r r r1 U s zCloud.device_name_to_devicec C s | j �|�S r )r �
get_ipath_curr2 r r r r3 X s zCloud.get_ipath_curc C s | j �|�S r )r � get_cpathr2 r r r r4 [ s zCloud.get_cpathc C s | j �|�S r )r � get_ipathr2 r r r r5 ^ s zCloud.get_ipath)N)NF)T)FF)N)N)N)�__name__�
__module__�__qualname__r r �propertyr r r'