관리-도구
편집 파일: cloud.cpython-39.pyc
a ����'�Dg�����������������������@���st���d�dl�Z�d�dlZd�dlZd�dlmZ�d�dlmZ�d�dlmZm Z �d�dl mZ�d�dlm Z �e�e�ZG�dd��d�ZdS�) �����N)�Optional)�Distro)�Paths�Runners)�events)� DataSourcec�������������������@���s����e�Zd�Zd!eeeeeee j �d�dd�Zedd���Z d"dd �Zd d��Zd#d d�Zdd��Zedd���Zdd��Zdd��Zd$dd�Zdd��Zd%dd�Zd&dd�Zd'dd �ZdS�)(�CloudN)� datasource�paths�cfg�distro�runners�reporterc�����������������C���s@���||�_�||�_||�_||�_||�_|d�u�r6tjdddd�}||�_d�S�)Nzunnamed-cloud-reporterF)�name�descriptionZreporting_enabled)r ���r ���r����_cfg�_runnersr����ReportEventStackr���)�selfr ���r ���r���r���r ���r�����r����3/usr/lib/python3.9/site-packages/cloudinit/cloud.py�__init__ ���s���� �zCloud.__init__c�����������������C���s���t��|�j�S��N)�copy�deepcopyr����r���r���r���r���r���6���s����z Cloud.cfgFc�����������������C���s���|�j��|||||�S�)a���Run a function gated by a named semaphore for a desired frequency. The typical case for this method would be to limit running of the provided func to a single well-defined frequency: PER_INSTANCE, PER_BOOT or PER_ONCE The semaphore provides a gate that persists across cloud-init boot stage boundaries so multiple modules can share this state even if they happen to be run in different boot stages or across reboots. )r����run)r���r���Zfunctor�argsZfreqZ clear_on_failr���r���r���r���;���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�LOGZwarning�dirname)r���r����fnr���r���r����get_template_filenameI���s���� �zCloud.get_template_filenameTc�����������������C���s���|�j��|�S�r���)r ����get_userdata)r���Zapply_filterr���r���r���r%���U���s����zCloud.get_userdatac�����������������C���s ���|�j����S�r���)r ����get_instance_idr���r���r���r���r&���X���s����zCloud.get_instance_idc�����������������C���s���|�j�jS�r���)r ����launch_indexr���r���r���r���r'���[���s����zCloud.launch_indexc�����������������C���s ���|�j����S�r���)r ����get_public_ssh_keysr���r���r���r���r(���_���s����zCloud.get_public_ssh_keysc�����������������C���s ���|�j����S�r���)r ���� get_localer���r���r���r���r)���b���s����zCloud.get_localec�����������������C���s���|�j�j||d�S�)N)�fqdn� metadata_only)r ����get_hostname)r���r*���r+���r���r���r���r,���e���s�����zCloud.get_hostnamec�����������������C���s���|�j��|�S�r���)r ����device_name_to_device�r���r���r���r���r���r-���j���s����zCloud.device_name_to_devicec�����������������C���s���|�j��|�S�r���)r ���� get_ipath_curr.���r���r���r���r/���m���s����zCloud.get_ipath_curc�����������������C���s���|�j��|�S�r���)r ���� get_cpathr.���r���r���r���r0���p���s����zCloud.get_cpathc�����������������C���s���|�j��|�S�r���)r ���� get_ipathr.���r���r���r���r1���s���s����zCloud.get_ipath)N)NF)T)FF)N)N)N)�__name__� __module__�__qualname__r���r����dictr���r���r���r���r���r����propertyr���r���r$���r%���r&���r'���r(���r)���r,���r-���r/���r0���r1���r���r���r���r���r������s0������ r���)r���Zloggingr����typingr���Zcloudinit.distrosr���Zcloudinit.helpersr���r���Zcloudinit.reportingr���Zcloudinit.sourcesr���Z getLoggerr2���r!���r���r���r���r���r����<module>���s���