Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/

[FILE] cc_ansible.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apk_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_pipelining.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_bootcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_byobu.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ca_certs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_chef.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disable_ec2_metadata.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disk_setup.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_fan.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_final_message.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_growpart.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_grub_dpkg.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_install_hotplug.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keyboard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keys_to_console.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_landscape.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_locale.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_lxd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mcollective.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mounts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ntp.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_package_update_upgrade_install.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_phone_home.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_power_state_change.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_puppet.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_raspberry_pi.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_reset_rmc.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resizefs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resolv_conf.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rh_subscription.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rsyslog.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_runcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_salt_minion.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_boot.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_instance.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_once.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_user.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_vendor.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_seed_random.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_passwords.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_snap.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_spacewalk.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_authkey_fingerprints.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_import_id.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_timezone.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_autoinstall.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_drivers.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_pro.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_etc_hosts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_users_groups.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_wireguard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files_deferred.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_yum_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_zypper_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] modules.cpython-310.pyc [ edit | delete | rename ]
[FILE] schema.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_write_files.cpython-310.pyc

o

��i��
@s�UdZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZd	Zd
ZdZe�e�Zdd
gedgd�Zeed<dedede
deddf
dd�Zdd�Zd#dedeefdd�Zdd�Zdd �Z d!d"�Z!dS)$z"Write Files: write arbitrary files�N)�Optional)�
url_helper�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCEi�Fz
text/plain�cc_write_files�all�write_files)�id�distros�	frequency�activate_by_schema_keys�meta�name�cfg�cloud�args�returncCsP|�dg�}dd�|D�}|st�d|�dSt�|j�}t|||jj|�dS)NrcSsg|]}t�|dt�s|�qS)�defer)r�get_cfg_option_bool�
DEFAULT_DEFER)�.0�f�r�A/usr/lib/python3/dist-packages/cloudinit/config/cc_write_files.py�
<listcomp>$s��zhandle.<locals>.<listcomp>zESkipping module named %s, no/empty 'write_files' key in configuration)	�get�LOG�debugr�fetch_ssl_details�pathsr�distro�
default_owner)rrrr�	file_list�filtered_files�ssl_detailsrrr�handle"s��r(cCsf|sd}|����}|dvrdgS|dvrddgS|dvr dgS|tkr'tgS|r0t�d|t�tgS)N�)�gz�gzip�application/x-gzip)z	gz+base64zgzip+base64zgz+b64zgzip+b64�application/base64)�b64�base64z%Unknown encoding type %s, assuming %s)�lower�strip�TEXT_PLAIN_ENCr�warning)�
encoding_typerrr�canonicalize_extraction4s$�r5�ownerr'c	Cs|sdSt|�D]x\}}|�d�}|st�d|d|�qtj�|�}t|�dd�||�dd�|�dd��}|durDt�d|d|�qt�	|�d|��\}}	t
|�d	�t�}
t�|d
�r_dnd}tj
||||
||	d
�t�|||	�t�|�|
kr�t�||
�qdS)N�pathz3No path provided to write for entry %s in module %s��source�content�encodingz>No content could be loaded for entry %s in module %s; skippingr6�permissions�append�ab�wb)�omode�mode�user�group)�	enumeraterrr3�osr7�abspath�read_url_or_decoder�extract_usergroup�decode_perms�
DEFAULT_PERMSr�
write_file�chownbyname�get_permissions�chmod)r�filesr6r'�i�f_infor7�contents�u�g�permsr@rrrrMsH
�


�����cCs�|dur|Szt|ttf�rt|�WStt|�d�WSttfyRg}||fD]}z	|�d|�Wq)tyD|�d|�Yq)wtjdg|�R�|YSw)N�z%oz%rz0Undecodable permissions %s, returning default %s)	�
isinstance�int�float�str�	TypeError�
ValueErrorr=rr3)�perm�default�reps�rrrrrIxs"
��rIcCs�|durdn|�dd�}t|�}|dur|sdSd}|r@ztj||�dd�dd|d�j}Wnty?t�td|�d}Ynw|durO|sOt	|�}t
||�}|S)N�urir)�headers�)rb�retries�sec_betweenr'zVFailed to retrieve contents from source "%s"; falling back to data from "contents" keyF)r�boolr�read_file_or_urlrR�	Exceptionr�logexcrr5�extract_contents)r9r'r:r;�url�use_url�result�extractionsrrrrG�s8
����

rGcCsJ|}|D]}|dkrtj|ddd�}q|dkrt�|�}q|tkr"	q|S)Nr,F)�quiet�decoder-)r�decomp_gzipr/�	b64decoder2)rR�extraction_typesrm�trrrrj�s�rj)N)"�__doc__r/�loggingrE�typingr�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsrrJrr2�	getLogger�__name__rr�__annotations__rZ�listr(r5�dictrrIrGrjrrrr�<module>s2
�+%
Upload File: