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

[FILE] boot_hook.cpython-310.pyc [ edit | delete | rename ]
[FILE] cloud_config.cpython-310.pyc [ edit | delete | rename ]
[FILE] jinja_template.cpython-310.pyc [ edit | delete | rename ]
[FILE] shell_script.cpython-310.pyc [ edit | delete | rename ]
[FILE] shell_script_by_frequency.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

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

o

��i@	�@s�ddlZddlZddlmZddlmZddlmZmZm	Z	e�
e�Zedede	diZ
dd	�Zd
d�Zdd
�ZGdd�de�ZdS)�N)�util)�Handler)�
PER_ALWAYS�PER_INSTANCE�PER_ONCEzper-bootzper-instancezper-oncecCsdt|��}|S)Nztext/x-shellscript-)�path_map)�freq�	mime_type�r
�N/usr/lib/python3/dist-packages/cloudinit/handlers/shell_script_by_frequency.py�get_mime_type_by_frequencysrcCst|}tj�||�}|S)z]Return the frequency-specific subfolder for a given frequency constant
    and parent folder.)r�os�path�join)r�scripts_dir�freqPath�folderr
r
r�get_script_folder_by_frequencysrcCsJtj�|�}t�|�}t||�}tj�||�}t�|�}t�||d�dS)z|Given a filename, a payload, a frequency, and a scripts folder, write
    the payload to the correct frequency-specific pathi�N)	r
r�basenamer�clean_filenamerr�dos2unix�
write_file)�script_path�payload�	frequencyr�filenamerrr
r
r�write_script_by_frequency#s


rc@s eZdZdZdd�Zdd�ZdS)�ShellScriptByFreqPartHandlerz=Common base class for the frequency-specific script handlers.cKsJt�|t�t|�g|_||_|�d�|_d|vr#|�|d�|_dSdS)N�scriptsr)r�__init__rr�prefixes�script_frequency�	get_cpathr)�selfr!�paths�_kwargsr
r
rr1s�z%ShellScriptByFreqPartHandler.__init__cCs8|durtj�|�}t�|�}t|||j|j�dSdS)N)r
rrrrrr!r)r#�data�ctyperrrrr
r
r�handle_part9s
��z(ShellScriptByFreqPartHandler.handle_partN)�__name__�
__module__�__qualname__�__doc__rr(r
r
r
rr.sr)�loggingr
�	cloudinitr�cloudinit.handlersr�cloudinit.settingsrrr�	getLoggerr)�LOGrrrrrr
r
r
r�<module>s
�
Upload File: