
    x[h              
           % S r SSKrSSKrSSKJrJrJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJrJr  SS	KJr  SS
KJr  S\/\/ S.r\\S'   \R0                  " \5      rSrSrS\S\
S\4S jrS\S\
S\S\ SS4
S jr!g)z3Install hotplug udev rules if supported and enabled    N)stagessubputil)Cloud)Config)
MetaSchema)ALL_DISTROS)
EventScope	EventType)PER_INSTANCE)
DataSourcecc_install_hotplug)iddistros	frequencyactivate_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_enabledc                 (   [         R                  U R                  [         R                  /5      R                  [        R
                  [        5       5      ;   n[        R                  " U U[         R                  [        R
                  S9nU(       a  U(       d  [        R                  R                  [        5      (       aH  [        R                  S5        [        R                   " [        5        ["        R"                  " / SQ5        g U(       a  [        R%                  S5        g [        R                  S5        g ["        R&                  " S5      (       d  [        R                  S5        g U R(                  b  U R(                  OSnU(       a  S	U-   nS
n[        R                  R                  U5      (       d  Sn[        R+                  S5        [        R,                  " [        [.        R1                  XVS9S9  ["        R"                  " / SQ5        g )N)r   r   event_source_typescopez!Uninstalling hotplug, not enabled)udevadmcontrolz--reload-ruleszOHotplug is unsupported by current datasource. Udev rules will NOT be installed.z%Skipping hotplug install, not enabledr   z+Skipping hotplug install, udevadm not found 
z/usr/libexec/cloud-initz/usr/lib/cloud-initzInstalling hotplug.)extra_rules
libexecdir)filenamecontent)r   HOTPLUGget_supported_eventsgetr
   NETWORKsetr   update_event_enabledospathexistsHOTPLUG_UDEV_PATHLOGdebugr   del_filer   warningwhichextra_hotplug_udev_rulesinfo
write_fileHOTPLUG_UDEV_RULES_TEMPLATEformat)r   r   r   hotplug_supportedhotplug_enabledr   r   s          E/usr/lib/python3/dist-packages/cloudinit/config/cc_install_hotplug.pyinstall_hotplugr9   %   s   
 "))''):):(;<@@	

 11#++  	O /77>>+,,II9:MM+,II>? 	 %KK4 	 II=>::i  		?@ ..: 	++ 
 [(*J77>>*%%*
HH"#OO"+22# 3 
 	II67    namecloudargsreturnc                     SU;   =(       a/    SUS   ;   =(       a     SUS   S   ;   =(       a    SUS   S   S   ;   n[        UR                  X5        g )Nupdatesnetworkwhenhotplug)r9   r   )r;   r   r<   r=   r   s        r8   handlerD   [   se    S 	;Y'	;c)nY//	; Y	26::	  E$$cCr:   )"__doc__loggingr(   	cloudinitr   r   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.distrosr	   cloudinit.eventr
   r   cloudinit.settingsr   cloudinit.sourcesr   r   __annotations__	getLogger__name__r,   r+   r4   boolr9   strlistrD    r:   r8   <module>rV      s    9  	 ( ( ! # . ) 1 + ( }!	j  !
 I  3838	38 "38lD D6 D% Dt D Dr:   