+
    i@	                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHtHtH	t	 ] P                  ! ]4      t]R]R]	R/tR tR	 tR
 t ! R R]4      tR# )    N)util)Handler)
PER_ALWAYSPER_INSTANCEPER_ONCEzper-bootzper-instancezper-oncec                 &    R \         V ,           2pV# )ztext/x-shellscript-)path_map)freq	mime_types   & N/usr/lib/python3/dist-packages/cloudinit/handlers/shell_script_by_frequency.pyget_mime_type_by_frequencyr      s    %htn%56I    c                ^    \         V ,          p\        P                  P                  W4      pV# )zYReturn the frequency-specific subfolder for a given frequency constant
and parent folder.)r	   ospathjoin)r
   scripts_dirfreqPathfolders   &&  r   get_script_folder_by_frequencyr      s$     ~HWW\\+0FMr   c                   \         P                  P                  V 4      p\        P                  ! V4      p\        W#4      p\         P                  P                  WT4      p\        P                  ! V4      p\        P                  ! WaR4       R# )zxGiven a filename, a payload, a frequency, and a scripts folder, write
the payload to the correct frequency-specific pathi  N)	r   r   basenamer   clean_filenamer   r   dos2unix
write_file)script_pathpayload	frequencyr   filenamer   r   s   &&&&   r   write_script_by_frequencyr    #   s`     ww,H""8,H+ICF77<<)DmmG$GOOD5)r   c                   0   a  ] tR t^.t o RtR tR tRtV tR# )ShellScriptByFreqPartHandlerz=Common base class for the frequency-specific script handlers.c                    \         P                  ! V \        4       \        V4      .V n        Wn        VP                  R 4      V n        RV9   d    VP                  VR,          4      V n        R# R# )scriptsr   N)r   __init__r   r   prefixesscript_frequency	get_cpathr   )selfr'   paths_kwargss   &&&,r   r%   %ShellScriptByFreqPartHandler.__init__1   s\    z*34DEF 0 ??95G#$w}/EFD $r   c                    VeY   \         P                  P                  V4      p\        P                  ! V4      p\        W4V P                  V P                  4       R # R # )N)r   r   r   r   r   r    r'   r   )r)   datactyper   r   r   r   s   &&&&&& r   handle_part(ShellScriptByFreqPartHandler.handle_part9   sL    "ww''4H**84H%d&;&;T=M=M #r   )r&   r'   r   N)	__name__
__module____qualname____firstlineno____doc__r%   r0   __static_attributes____classdictcell__)__classdict__s   @r   r"   r"   .   s     GG r   r"   )loggingr   	cloudinitr   cloudinit.handlersr   cloudinit.settingsr   r   r   	getLoggerr2   LOGr	   r   r   r    r"    r   r   <module>rA      sZ     	  & A A! 
.j
*7 r   