HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/cloudinit/__pycache__/cloud.cpython-310.pyc
o

�Ad�
�@sxddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
ddlmZe�e�ZGdd	�d	�ZdS)
�N)�Optional)�log)�Distro)�Paths�Runners)�events)�
DataSourcec@s�eZdZ	d(dedededededee	j
fdd	�Zd
d�Ze
dd
��Zd)dd�Zdd�Zd*dd�Zdd�Ze
dd��Zdd�Zdd�Zd+dd�Zd d!�Zd(d"d#�Zd(d$d%�Zd(d&d'�ZdS),�CloudN�
datasource�paths�cfg�distro�runners�reportercCs@||_||_||_||_||_|durtjdddd�}||_dS)Nzunnamed-cloud-reporterF)�name�description�reporting_enabled)r
rr
�_cfg�_runnersr�ReportEventStackr)�selfr
rrr
rr�r�1/usr/lib/python3/dist-packages/cloudinit/cloud.py�__init__ s	�
zCloud.__init__cCst��t�|j�dS�N)�logging�resetLogging�setupLoggingr�rrrr�
cycle_logging9szCloud.cycle_loggingcCst�|j�Sr)�copy�deepcopyrrrrrr=sz	Cloud.cfgFcCs|j�|||||�Sr)r�run)rr�functor�args�freq�
clear_on_failrrrr"Bsz	Cloud.runcCs6|jj|}tj�|�st�dtj�|�|�dS|S)Nz-No template found in %s for template named %s)r�template_tpl�os�path�isfile�LOG�warning�dirname)rr�fnrrr�get_template_filenameEs
�zCloud.get_template_filenameTcC�|j�|�Sr)r
�get_userdata)r�apply_filterrrrr1Q�zCloud.get_userdatacC�
|j��Sr)r
�get_instance_idrrrrr5T�
zCloud.get_instance_idcCs|jjSr)r
�launch_indexrrrrr7WszCloud.launch_indexcCr4r)r
�get_public_ssh_keysrrrrr8[r6zCloud.get_public_ssh_keyscCr4r)r
�
get_localerrrrr9^r6zCloud.get_localecCs|jj||d�S)N)�fqdn�
metadata_only)r
�get_hostname)rr:r;rrrr<as�zCloud.get_hostnamecCr0r)r
�device_name_to_device�rrrrrr=fr3zCloud.device_name_to_devicecCr0r)r�
get_ipath_curr>rrrr?ir3zCloud.get_ipath_curcCr0r)r�	get_cpathr>rrrr@lr3zCloud.get_cpathcCr0r)r�	get_ipathr>rrrrAor3zCloud.get_ipathr)NF)T)FF)�__name__�
__module__�__qualname__rr�dictrrrrrrr�propertyrr"r/r1r5r7r8r9r<r=r?r@rArrrrr	s>������
�






r	)r r(�typingr�	cloudinitrr�cloudinit.distrosr�cloudinit.helpersrr�cloudinit.reportingr�cloudinit.sourcesr�	getLoggerrBr+r	rrrr�<module>s