Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/__pycache__/

[FILE] boot_proto.cpython-310.pyc [ edit | delete | rename ]
[FILE] config.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_custom_script.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_file.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_nic.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_passwd.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_source.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_error.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_event.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_state.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] nic.cpython-310.pyc [ edit | delete | rename ]
[FILE] nic_base.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/__pycache__/config_custom_script.cpython-310.pyc

o

��i"�@s�ddlZddlZddlZddlmZmZe�e�ZGdd�de	�Z
Gdd�d�ZGdd�d�ZGd	d
�d
e�Z
Gdd�de�ZdS)
�N)�subp�utilc@seZdZdS)�CustomScriptNotFoundN)�__name__�
__module__�__qualname__�rr�[/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/config_custom_script.pyrsrc@s*eZdZdZdZej�ee�ZdZ	dZ
dS)�CustomScriptConstantz/root/.customizationzcustomize.shz)/.guest-customization-post-reboot-pendingzpost-customize-guest.shN)rrr�CUSTOM_TMP_DIR�CUSTOM_SCRIPT_NAME�os�path�join�
CUSTOM_SCRIPT�POST_CUSTOM_PENDING_MARKER�POST_CUSTOM_SCRIPT_NAMErrrr	r
sr
c@seZdZdd�Zdd�ZdS)�RunCustomScriptcCs ||_||_tj�||�|_dS�N)�
scriptname�	directoryr
rr�
scriptpath)�selfrrrrr	�__init__!szRunCustomScript.__init__cCsptj�|j�std|j��t�tj�t	�
dtj�t�|jtj�t�
tj��dd�}tjtj|dd�dS)Nz3Script %s not found!! Cannot execute custom script!zCopying custom script to %s�
�id)�mode)r
r�existsrrr�
ensure_dirr
r�LOG�debugr�copy�load_text_file�replace�
write_file)r�contentrrr	�prepare_script&s&�����
�zRunCustomScript.prepare_scriptN)rrrrr&rrrr	r src@seZdZdd�ZdS)�PreCustomScriptcCs&t�d�|��t�tjdg�dS)z7Executing custom script with precustomization argument.z"Executing pre-customization script�precustomizationN)rr r&rr
r)rrrr	�execute>s
zPreCustomScript.executeN)rrrr)rrrr	r'=sr'cs$eZdZ�fdd�Zdd�Z�ZS)�PostCustomScriptcs.tt|��||�||_tj�|tj�|_	dSr)
�superr*r�ccScriptsDirr
rrr
r�ccScriptPath)rrrr,��	__class__rr	rFs

�zPostCustomScript.__init__cCsn|��t�d|j�t�tj�|j	t
j�|j�t�|j�}t�
|j|jtjB�t�d�t�t
j�dS)z�
        This method copy the post customize run script to
        cc_scripts_per_instance directory and let this
        module to run post custom script.
        z'Copying post customize run script to %sz*Creating post customization pending markerN)r&rr r-rr!r
rrrr
r�stat�chmod�st_mode�S_IEXEC�info�ensure_filer)r�strrr	r)Ms��
zPostCustomScript.execute)rrrrr)�
__classcell__rrr.r	r*Esr*)�loggingr
r0�	cloudinitrr�	getLoggerrr�	Exceptionrr
rr'r*rrrr	�<module>s

Upload File: