HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_install_hotplug.cpython-38.pyc
U

Ӈg��@s�UdZddlZddlZddlmZmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZmZdd	lmZdd
lmZdegegd�Zeed
<e�e�ZdZdZee
ed�dd�Zee
ee dd�dd�Z!dS)z3Install hotplug udev rules if supported and enabled�N)�stages�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�
EventScope�	EventType)�PER_INSTANCE)�
DataSourceZcc_install_hotplug)�idZdistrosZ	frequencyZactivate_by_schema_keys�metaz2/etc/udev/rules.d/90-cloud-init-hook-hotplug.rulesz�# Installed by cloud-init due to network hotplug userdata
ACTION!="add|remove", GOTO="cloudinit_end"{extra_rules}
LABEL="cloudinit_hook"
SUBSYSTEM=="net", RUN+="{libexecdir}/hook-hotplug"
LABEL="cloudinit_end"
)�
datasource�cfg�network_hotplug_enabledcCstj|�tjg��tjt��k}tj||tjtjd�}|r>|s�t	j
�t�rpt
�d�t�t�t�dddg�n|r�t
�d�n
t
�d�dSt�d�s�t
�d�dS|jdk	r�|jnd	}|r�d
|}d}t	j
�|�s�d}t
�d
�tjttj||d�d�t�dddg�dS)N)rrZevent_source_typeZscopez!Uninstalling hotplug, not enabledZudevadmZcontrolz--reload-ruleszOHotplug is unsupported by current datasource. Udev rules will NOT be installed.z%Skipping hotplug install, not enabledz+Skipping hotplug install, udevadm not found��
z/usr/libexec/cloud-initz/usr/lib/cloud-initzInstalling hotplug.)�extra_rules�
libexecdir)�filenameZcontent)r
ZHOTPLUGZget_supported_events�getr	ZNETWORK�setrZupdate_event_enabled�os�path�exists�HOTPLUG_UDEV_PATH�LOG�debugrZdel_filerZwarningZwhichZextra_hotplug_udev_rules�infoZ
write_file�HOTPLUG_UDEV_RULES_TEMPLATE�format)rrrZhotplug_supportedZhotplug_enabledrr�r"�E/usr/lib/python3/dist-packages/cloudinit/config/cc_install_hotplug.py�install_hotplug%sX���

�


��
��r$)�namer�cloud�args�returncCsJd|ko6d|dko6d|ddko6d|dddk}t|j||�dS)NZupdatesZnetworkZwhenZhotplug)r$r)r%rr&r'rr"r"r#�handle[s
���r))"�__doc__ZloggingrZ	cloudinitrrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.eventr	r
Zcloudinit.settingsrZcloudinit.sourcesrr�__annotations__Z	getLogger�__name__rrr �boolr$�str�listr)r"r"r"r#�<module>s.�

�6