%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/cloudinit/config/__pycache__/cc_install_hotplug.cpython-39.pyc

a

'�Dg��@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_enabledcCstj|�tjg��tjt��v}tj||tjtjd�}|r>|s�t	j
�t�rnt
�d�t�t�t�gd��n|r~t
�d�n
t
�d�dSt�d�s�t
�d�dS|jdur�|jnd}|r�d	|}d
}t	j
�|�s�d}t
�d�tjttj||d
�d�t�gd��dS)N)rrZevent_source_typeZscopez!Uninstalling hotplug, not enabled)�udevadmZcontrolz--reload-ruleszOHotplug is unsupported by current datasource. Udev rules will NOT be installed.z%Skipping hotplug install, not enabledrz+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_filerZwarning�whichZextra_hotplug_udev_rules�infoZ
write_file�HOTPLUG_UDEV_RULES_TEMPLATE�format)rrrZhotplug_supportedZhotplug_enabledrr�r$�G/usr/lib/python3.9/site-packages/cloudinit/config/cc_install_hotplug.py�install_hotplug%sT���

�


��
��r&)�namer�cloud�args�returncCsJd|vo6d|dvo6d|ddvo6d|dddv}t|j||�dS)NZupdates�networkZwhenZhotplug)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

Zerion Mini Shell 1.0