+
    i}&                     t   ^ RI t ^ RIt^ RIt^ RIHtHtHt ^ RIHtH	t	H
t
 ]P                  ! ]4      tRtRtRtRt]].tR.tR	tR
tRRRRRRRRRRRRRRRRRRRRRRRR/t]! ]! ]P3                  4       4      R R 7      t ! R! R"] P6                  R#7      tR$ tR% tR& tR' t R( t!R) t"R* t#R+ t$]
3R, lt%R.R- lt&R# )/    N)importer
type_utilsutil)FREQUENCIES
PER_ALWAYSPER_INSTANCEztext/x-not-multipartzapplication/octet-stream__end__	__begin__ztext/part-handlerzpart-handler-%03dz	part-%03dz#includeztext/x-include-urlz#include-onceztext/x-include-once-urlz#!ztext/x-shellscriptz#cloud-configztext/cloud-configz#part-handlerz#cloud-boothookztext/cloud-boothookz#cloud-config-archiveztext/cloud-config-archivez#cloud-config-jsonpztext/cloud-config-jsonpz## template: jinjaztext/jinja2ztext/x-shellscript-per-bootztext/x-shellscript-per-instanceztext/x-shellscript-per-oncec                 &    ^ \        V 4      ,
          # )r   )len)es   &=/usr/lib/python3/dist-packages/cloudinit/handlers/__init__.py<lambda>r   >   s    QQZ    )keyc                   Z   a  ] tR t^Bt o RR ltR tR t]P                  R 4       t	Rt
V tR# )Handlerc                    W n         Wn        R # N)handler_version	frequency)selfr   versions   &&&r   __init__Handler.__init__C   s    &"r   c                Z    \         P                  ! V 4      : R V P                  4       : R2# )z: [])r   obj_name
list_types)r   s   &r   __repr__Handler.__repr__G   s    '0068IJJr   c                    \        V R 4      '       g   \        R4      h\        V R 4       Uu. uF  p\        V,          NK  	  up# u upi )prefixesz#Missing prefixes subclass attribute)hasattrNotImplementedErrorgetattrINCLUSION_TYPES_MAP)r   prefixs   & r   r   Handler.list_typesJ   sQ    tZ((%&KLL &dJ77F $F++7  s   Ac                    \        4       hr   )r%   )r   argskwargss   &*,r   handle_partHandler.handle_partT   s    !##r   )r   r   N)   )__name__
__module____qualname____firstlineno__r   r    r   abcabstractmethodr-   __static_attributes____classdictcell__)__classdict__s   @r   r   r   B   s/     #K 	$ $r   r   )	metaclassc           
      B   V P                   pV\        8X  g   V\        8X  d   V\        8X  g   R #  V P                  p\	        V4      pVR,          p \        P                  RV VVVV4       V^8X  d   V P                  WW#WE4       R # V^8X  d   V P                  WW#V4       R # V^8X  d   V P                  WW#4       R # \        RV,          4      h  \
        \        \        3 d    ^p Li ; i  \         d%    \        P                  ! \        RT TTTT4        R # i ; i)NContent-Typez1Calling handler %s (%s, %s, %s) with frequency %szUnknown module version %sz8Failed calling handler %s (%s, %s, %s) with frequency %s)r   r   r   r   int	TypeError
ValueErrorAttributeErrorLOGdebugr-   	Exceptionr   logexc)	moddatafilenamepayloadr   headersmod_freqmod_vercontent_types	   &&&&&&   r   run_partrL   Y   s   }}HJ%(l*B%%g, >*L
		?	
 a<OOHy \OOD9M\OODB8GDEE1 z>2 2  	
F	
	
s5   C 4C/ C/ $C/ ?C/ C,+C,/+DDc                 2    R \         /p\        WRRW#4       R# r;   N)CONTENT_STARTrL   rD   rE   r   rH   s   &&& r   
call_beginrQ      s      	G SdI7r   c                 2    R \         /p\        WRRW#4       R# rN   )CONTENT_ENDrL   rP   s   &&& r   call_endrT      s      	G SdI7r   c                 "   V R ,          p\         V,          pV R,          p\        P                  P                  V R,          RV,          4      pVP	                  R4      '       g
   RV,          p\
        P                  ! WsR4       V R,          p \        \        P                  ! V4      4      p	\        WR,          V4       VP                  V	R	R
7       V^,           V R &   R#   \         d"    \
        P                  ! \        RTT4        R# i ; i)handlercountr   
handlerdirz%sz.pyz%s.pyi  handlersrE   T)initializedz7Failed at registering python file: %s (part handler %s)N)PART_HANDLER_FN_TMPLospathjoinendswithr   
write_filefixup_handlerr   import_modulerQ   registerrB   rC   r@   )
pdata_ctype	_filenamerG   curcountmodnamer   modfnamerX   rD   s
   &&&&      r   walker_handle_handlerri      s    ^$H"h/Gk"Iww||E,/1ABHU##h'OOHu-Z H
H227;<3fy1 	#40 (1n 
E		

s   AC" "(DDc                 &    \        V \        4      '       d   V P                  R ^4      ^ ,          pM3V R^V,           P                  RR7      P                  R ^4      ^ ,          p\	        V4      V8  d   VRV pV#   \
         d
    T ^ T p T# i ; i)
Nignore)errors)
isinstancestrsplitdecoder   UnicodeDecodeError)blobsizestarts   && r   _extract_first_or_bytesrv      s    dC  JJtQ'*E 1t8$++8+<BB4KANEu:%4LE L  QtLs   A8A< <BBc                      V P                  R 4      #   \        \        3 d)     T P                  R4      u #   \         d      T # i ; i\         d     T # i ; i)string_escapeunicode_escape)encodeLookupErrorr=   r?   )texts   &r   _escape_stringr}      sl    {{?++# 	;;/00 	 K	   	Ks5    A8AAAAAAAc                     VR ,          pW@P                  R4      9   d   \        P                  RV4       R# V\        9   d   \	        WW4       R# V R,          pWE9   d'   \        WT,          V R,          VVV R,          V4       R# V'       d\   \        V^4      pR\        V4      ,          pV\        8X  d   \        P                  RVV4       R# \        P                  R	VV4       R# \        P                  R
V4       R# )r;   excludedzcontent_type "%s" is excludedNrX   rE   r   z'%s...'z)Unhandled non-multipart (%s) userdata: %sz0Unhandled unknown content-type (%s) userdata: %szEmpty payload of type %s)
getr@   rA   PART_CONTENT_TYPESri   rL   rv   r}   NOT_MULTIPART_TYPEwarning)rE   rF   rG   rH   rK   rX   ru   detailss   &&&&    r   walker_callbackr      s    >*Lxx
++		1<@))d(DJH"L	
 
'4~e45--KK; KKB 			,l;r   c                 |   ^ pV P                  4        F  pVP                  4       R8X  d   K  VP                  4       pVf   \        pVP	                  4       pV'       g   \
        V,          p\        V4      p\        P                  V4       WWR&   \        P                  ! V4      pV! W&W4       V^,           pK  	  R# )r   	multipartNr;   )walkget_content_maintypeget_content_type
OCTET_TYPEget_filenamePART_FN_TPLdictr@   rA   r   fully_decoded_payload)	msgcallbackrE   partnumpartctyperF   rH   rG   s	   &&&      r   r   r      s    G
$$&+5%%'=E$$&"g.Ht*		'"',,T22A+% r   c                     \        V R 4      '       g   \        V R ^4       \        V R4      '       g   \        V RV4       V # V P                  pV'       d"   V\        9  d   \        P                  RW4       V # )r   r   z&Handler %s has an unknown frequency %s)r$   setattrr   r   r@   r   )rD   def_freqfreqs   && r   r`   r`     sf    3)**&*3$$[(+
 J }}D+KK@#LJr   c                      \         P                  ! V 4      P                  4       pTP	                  4       p\
         F)  pTP                  T4      '       g   K  \        T,          u # 	  T#   \         d    Tu # i ; ir   )r   decode_binarylowerrr   lstripINCLUSION_SRCH
startswithr'   )rG   default
payload_lcr|   s   &&  r   type_from_starts_withr   #  ss    ''0668
 ""$J  &&&t,,  N  s   $A+ +A;:A;r   )'r4   loggingr[   	cloudinitr   r   r   cloudinit.settingsr   r   r   	getLoggerr0   r@   r   r   rS   rO   CONTENT_SIGNALSr   rZ   r   r'   sortedlistkeysr   ABCMetar   rL   rQ   rT   ri   rv   r}   r   r   r`   r    r   r   <module>r      s&     	 0 0 D D! ,  (
  +. ** *   $.
((,84-
 "#@%'H!#@! ( 		!	!	#$+?
$ $.-
`88
4$$$<R. !- 		r   