+
    i                        ^ RI t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIH	t	H
t
HtHtHt ^ RIHt ^ RIt^ RIHtHt ^ RIHt ]P.                  ! ]4      tR&R R	 llt ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R]4      t! ! R R]4      t" ! R R]4      t# ! R R]4      t$ ! R R]4      t% ! R R]4      t& ! R  R!]4      t' ! R" R#]4      t( ! R$ R%]4      t)R# )'    N)datetimetimezone)StringIO)AnyDictListOptionalTuple)ElementTree)subpversion)UrlErrorc                ^    V ^8  d   QhR\         \        ,          R\        R\        R\        /# )   data	delimiter	quotecharreturn)r   str)formats   "@/usr/lib/python3/dist-packages/cloudinit/sources/azure/errors.py__annotate__r      s0     & &
s)& #&69&&    c           	        \        4       ;_uu_ 4       p\        P                  ! VVV\        P                  R7      P	                  V 4       VP                  4       P                  4       uuRRR4       #   + '       g   i     R# ; i)zEncode report data with csv.)r   r   quotingN)r   csvwriterQUOTE_MINIMALwriterowgetvaluerstrip)r   r   r   ios   &&& r   encode_reportr#      sV     
r

%%		

 (4. {{}##% 
s   AA33B	c                   p   a  ] tR t^&t o RR/V 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lR
 ltRtV t	R# )ReportableErrorsupporting_dataNc                P   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RR/# )r   reasonr&   r   N)r   r	   r   r   )r   __classdict__s   "r   r   ReportableError.__annotate__'   s2     4 44/7S#X/G4	4r   c                   R \         P                  ! 4        2V n        RV n        Wn        V'       d   W n        M/ V n        \        P                  ! \        P                  4      V n
        R# )zCloud-Init/z%https://aka.ms/linuxprovisioningerrorN)r   version_stringagentdocumentation_urlr(   r&   r   nowr   utc	timestamp)selfr(   r&   s   &&$r   __init__ReportableError.__init__'   sN     #7#9#9#;"<=
!H#2 #%D !hll3r   c                6   < V ^8  d   QhRS[ S[,          RS[/# )r   vm_idr   )r	   r   )r   r)   s   "r   r   r*   5   s%     # # }# 
	#r   c               B   R RV P                    2RV P                   2.pY P                  P                  4        UUu. uF  w  r4V RV 2NK  	  upp,          pVRV 2RV P                  P                  4        2RV P                   2.,          p\        V4      # u uppi )zresult=errorzreason=zagent==zvm_id=z
timestamp=zdocumentation_url=)r(   r-   r&   itemsr1   	isoformatr.   r#   )r2   r6   r   kvs   &$   r   as_encoded_report!ReportableError.as_encoded_report5   s     dkk]#TZZL!

 	(<(<(B(B(DE(DA3as(DEEUG11345 !7!7 89
 	
 T"" Fs   Bc                    < V ^8  d   QhRS[ /# r   r   )bool)r   r)   s   "r   r   r*   H   s     
 
t 
r   c                    \        V\        4      ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # )N)
isinstancer%   r1   r(   r&   )r2   others   &&r   __eq__ReportableError.__eq__H   se    uo. > >%//1> >u||+> > $$(=(==		
r   c                    < V ^8  d   QhRS[ /# r@   r   )r   r)   s   "r   r   r*   P   s     
 
# 
r   c                    V P                   P                   R V P                   RV P                   RV P                   R2# )z(reason=z, timestamp=z, supporting_data=))	__class____name__r(   r1   r&   )r2   s   &r   __repr__ReportableError.__repr__P   sL    ~~&&' (kk] #( )#334A7	
r   )r-   r.   r(   r&   r1   )
rL   
__module____qualname____firstlineno__r3   r=   rE   rM   __static_attributes____classdictcell__)r)   s   @r   r%   r%   &   s5     4JN4 4# #&
 

 
r   r%   c                   >   a a ] tR t^Yt oV3R lV 3R lltRtVtV ;t# )$ReportableErrorDhcpInterfaceNotFoundc                $   < V ^8  d   QhRS[ RR/# )r   durationr   N)float)r   r)   s   "r   r   1ReportableErrorDhcpInterfaceNotFound.__annotate__Z   s     4 4 44 4r   c                B   < \         SV `  R 4       WP                  R&   R# )zfailure to find DHCP interfacerW   Nsuperr3   r&   )r2   rW   rK   s   &&r   r3   -ReportableErrorDhcpInterfaceNotFound.__init__Z   s    9:+3Z(r    rL   rO   rP   rQ   r3   rR   rS   __classcell__rK   r)   s   @@r   rU   rU   Y   s     4 4 4r   rU   c                   >   a a ] tR t^`t oV3R lV 3R lltRtVtV ;t# )ReportableErrorDhcpLeasec          
      f   < V ^8  d   QhRS[ S[,          RS[RS[ S[,          RS[ S[,          RR/# )r   driverrW   	interfacemac_addressr   N)r	   r   rX   )r   r)   s   "r   r   %ReportableErrorDhcpLease.__annotate__a   sI     : :: : C=	:
 c]: 
:r   c                   < \         SV `  R 4       WP                  R&   W P                  R&   W0P                  R&   W@P                  R&   R# )zfailure to obtain DHCP leasere   rW   rf   rg   Nr[   )r2   re   rW   rf   rg   rK   s   &&&&&r   r3   !ReportableErrorDhcpLease.__init__a   sK     	78)/X&+3Z(,5[).9]+r   r^   r_   ra   s   @@r   rc   rc   `   s     : : :r   rc   c                   >   a a ] tR t^pt oV3R lV 3R lltRtVtV ;t# )(ReportableErrorDhcpOnNonPrimaryInterfacec                   < V ^8  d   QhRS[ S[,          RS[ S[,          RS[ S[,          RS[ S[S[S[S[3,          ,          ,          RS[S[S[3,          RR/# )r   rf   re   routerstatic_routesleaser   N)r	   r   r   r
   r   r   )r   r)   s   "r   r   5ReportableErrorDhcpOnNonPrimaryInterface.__annotate__q   so     . . C=. 	.
 .  U38_ 56. CH~. 
.r   c                  < \         SV `  R 4       WP                  R&   W P                  R&   W0P                  R&   W@P                  R&   WPP                  R&   R# )z&failure to find primary DHCP interfacerf   re   rn   ro   rp   Nr[   )r2   rf   re   rn   ro   rp   rK   s   &$$$$$r   r3   1ReportableErrorDhcpOnNonPrimaryInterface.__init__q   sY     	AB,5[))/X&)/X&0=_-(-W%r   r^   r_   ra   s   @@r   rl   rl   p   s     . . .r   rl   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )ReportableErrorImdsUrlErrorc                *   < V ^8  d   QhRS[ RS[RR/# )r   	exceptionrW   r   N)r   rX   )r   r)   s   "r   r   (ReportableErrorImdsUrlError.__annotate__   s"     4 4X 4 44 4r   c               R  < \        VP                  \        P                  4      '       d   R pM\        VP                  \        P                  4      '       d   RpMR\        VP                  \        P
                  4      '       d   RpM%VP                  '       d   RVP                   R2pMRp\        SV `!  V4       VP                  '       d   VP                  V P                  R&   W P                  R&   \        V4      V P                  R&   VP                  V P                  R	&   R
# )z connection timeout querying IMDSzconnection error querying IMDSzread timeout querying IMDSzhttp error z querying IMDSzunexpected error querying IMDS	http_coderW   rw   urlN)rC   causerequestsConnectTimeoutConnectionErrorReadTimeoutcoder\   r3   r&   reprr{   )r2   rw   rW   r(   rK   s   &$$ r   r3   $ReportableErrorImdsUrlError.__init__   s    ioox'>'>??7F	)A)ABB5F	)=)=>>1F^^^"9>>"2.AF5F >>>09D  -+3Z(,0O[)&/mmU#r   r^   r_   ra   s   @@r   ru   ru      s     4 4 4r   ru   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )"ReportableErrorImdsInvalidMetadatac                *   < V ^8  d   QhRS[ RS[RR/# )r   keyvaluer   N)r   r   )r   r)   s   "r   r   /ReportableErrorImdsInvalidMetadata.__annotate__   s"     < <s <3 <4 <r   c                  < \         SV `  R V 24       WP                  R&   W P                  R&   \        V4      P                  V P                  R&   R# )zinvalid IMDS metadata for key=r   r   typeN)r\   r3   r&   r   rL   )r2   r   r   rK   s   &$$r   r3   +ReportableErrorImdsInvalidMetadata.__init__   sN    9#?@&)U#(-W%'+E{';';V$r   r^   r_   ra   s   @@r   r   r      s     < < <r   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )+ReportableErrorImdsMetadataParsingExceptionc                $   < V ^8  d   QhRS[ RR/# r   rw   r   N)
ValueError)r   r)   s   "r   r   8ReportableErrorImdsMetadataParsingException.__annotate__   s     < <Z <D <r   c               V   < \         SV `  R 4       \        V4      V P                  R&   R# )zerror parsing IMDS metadatarw   Nr\   r3   r   r&   r2   rw   rK   s   &$r   r3   4ReportableErrorImdsMetadataParsingException.__init__   s%    67,0O[)r   r^   r_   ra   s   @@r   r   r      s     < < <r   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )ReportableErrorOsDiskPpsFailurec                   < V ^8  d   QhRR/# r   r   Nr^   )r   r)   s   "r   r   ,ReportableErrorOsDiskPpsFailure.__annotate__   s     < <$ <r   c                &   < \         SV `  R 4       R# )zerror waiting for host shutdownNr\   r3   r2   rK   s   &r   r3   (ReportableErrorOsDiskPpsFailure.__init__   s    :;r   r^   r_   ra   s   @@r   r   r      s     < < <r   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )!ReportableErrorOvfInvalidMetadatac                $   < V ^8  d   QhRS[ RR/# )r   messager   NrH   )r   r)   s   "r   r   .ReportableErrorOvfInvalidMetadata.__annotate__   s     P P P Pr   c                ,   < \         SV `  R V 24       R# )z)unexpected metadata parsing ovf-env.xml: Nr   )r2   r   rK   s   &&r   r3   *ReportableErrorOvfInvalidMetadata.__init__   s    DWINOr   r^   r_   ra   s   @@r   r   r      s     P P Pr   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )"ReportableErrorOvfParsingExceptionc                8   < V ^8  d   QhRS[ P                  RR/# r   )ET
ParseError)r   r)   s   "r   r   /ReportableErrorOvfParsingException.__annotate__   s#     B BR]] Bt Br   c               D   < VP                   p\        SV `	  R V 24       R# )zerror parsing ovf-env.xml: N)msgr\   r3   )r2   rw   r   rK   s   &$ r   r3   +ReportableErrorOvfParsingException.__init__   s!    --6wi@Ar   r^   r_   ra   s   @@r   r   r      s     B B Br   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )!ReportableErrorUnhandledExceptionc                $   < V ^8  d   QhRS[ RR/# r   )	Exception)r   r)   s   "r   r   .ReportableErrorUnhandledException.__annotate__   s     @ @) @ @r   c                  < \         SV `  R 4       RP                  \        P                  ! \        V4      WP                  4      4      pVP                  R4      pVRRR1,          pRP                  V4      p\        P                  ! VP                  R4      4      P                  R4      p\        V4      V P                  R&   W`P                  R&   R# )zunhandled exception 
Nzutf-8rw   traceback_base64)r\   r3   join	tracebackformat_exceptionr   __traceback__splitbase64	b64encodeencodedecoder   r&   )r2   rw   tracetrace_linesreversed_trace_linesreversed_tracetrace_base64rK   s   &&     r   r3   *ReportableErrorUnhandledException.__init__   s    ./&&Y,C,C

 kk$'*4R40#78''(=(=g(FGNN
 -1O[)3?/0r   r^   r_   ra   s   @@r   r   r      s     @ @ @r   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )!ReportableErrorProxyAgentNotFoundc                   < V ^8  d   QhRR/# r   r^   )r   r)   s   "r   r   .ReportableErrorProxyAgentNotFound.__annotate__   s     8 8$ 8r   c                &   < \         SV `  R 4       R# )zazure-proxy-agent not foundNr   r   s   &r   r3   *ReportableErrorProxyAgentNotFound.__init__   s    67r   r^   r_   ra   s   @@r   r   r      s     8 8 8r   r   c                   >   a a ] tR t^t oV3R lV 3R lltRtVtV ;t# )&ReportableErrorProxyAgentStatusFailurec                8   < V ^8  d   QhRS[ P                  RR/# r   )r   ProcessExecutionError)r   r)   s   "r   r   3ReportableErrorProxyAgentStatusFailure.__annotate__   s!     : :$"<"< : :r   c                   < \         SV `  R 4       VP                  V P                  R&   VP                  V P                  R&   VP
                  V P                  R&   R# )z azure-proxy-agent status failure	exit_codestdoutstderrN)r\   r3   r   r&   r   r   r   s   &&r   r3   /ReportableErrorProxyAgentStatusFailure.__init__   sS    ;<,5,?,?[))2)9)9X&)2)9)9X&r   r^   r_   ra   s   @@r   r   r      s     : : :r   r   c                   F   a a ] tR t^t oRR/V3R lV 3R llltRtVtV ;t# )ReportableErrorVmIdentificationsystem_uuidNc                :   < V ^8  d   QhRS[ RS[S[,          RR/# )r   rw   r   r   N)r   r	   r   )r   r)   s   "r   r   ,ReportableErrorVmIdentification.__annotate__   s)     : :%:4<SM:	:r   c               r   < \         SV `  R 4       \        V4      V P                  R&   W P                  R&   R# )zfailure to identify Azure VM IDrw   r   Nr   )r2   rw   r   rK   s   &$$r   r3   (ReportableErrorVmIdentification.__init__   s5     	:;,0O[).9]+r   r^   r_   ra   s   @@r   r   r      s     :DH: : :r   r   )|')*r   r   loggingr   r   r   r"   r   typingr   r   r   r	   r
   	xml.etreer   r   r}   	cloudinitr   r   cloudinit.url_helperr   	getLoggerrL   LOGr#   r   r%   rU   rc   rl   ru   r   r   r   r   r   r   r   r   r   r^   r   r   <module>r      s   
  
   '  3 3 '  # )!& 0
i 0
f4? 4: : . .&4/ 40< <</ <<o <
P P
B B@ @(8 8
:_ ::o :r   