+
    ˜qgjý˜  ã                    ó   € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	H
t
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHtHtHtHtHtHtHt ^ R	I H!t!H"t"H#t#H$t$ ^ RI%t%^ R
I%H&t& ^ RI'H(t(H)t)H*t* ]PV                  ! ],4      t-Rt.]]R.]/3,          ,          t0R t1R t2R R lt3RNR R llt4R R lt5R R lt6 ! R R4      t7 ! R R]74      t8 ! R R]74      t9 ! R R4      t: ! R  R];4      t<R! t=R" R# lt>R$R/R% R& llt?R'RR(RR)^ R*^R+RR,RR-RR.RR/R0R1R0R$RR2RR3R4R5R0R6R7R8R4/R9 R: llt@ROR; R< lltARPR> R? lltB ! R@ RA]4      tCRB]D! RC4      R(RRD]-PŠ                  R,RR-RRERR$RRFRR6R7RGR0RHR=/RI RJ lltF ! RK RL4      tGRORM ltHR# )Qé    N)ÚThreadPoolExecutorÚTimeoutErrorÚas_completed)Ú	parsedate)Úpartial)Ú	NOT_FOUND)Úcount)Úcreate_default_context)	ÚAnyÚCallableÚIteratorÚListÚMappingÚ
NamedTupleÚOptionalÚTupleÚUnion)ÚquoteÚurlparseÚurlsplitÚ
urlunparse)Ú
exceptions)ÚperformanceÚutilÚversionÚREDACTEDÚUrlErrorc                 ó¢   € \        \        V R R7      4      pV^,          '       g!   V^,          '       d   V^,          V^&   RV^&   \        V4      # )Úhttp)ÚschemeÚ )Úlistr   r   )ÚurlÚ
parsed_urls   & Ú6/usr/lib/python3/dist-packages/cloudinit/url_helper.pyÚ	_cleanurlr&   1   sG   € Ü”h˜s¨6Ô2Ó3€JØ�a�=Œ=˜Z¨Ÿ]œ]ð # 1�ˆ
�1‰Øˆ
�1‰Ü�jÓ!Ð!ó    c                 ó2   € R  pT pV F  pV! W44      pK  	  V# )c                 óä   € \        \        V 4      4      pV^,          pV'       d!   VP                  R4      '       g
   VR,          pV\        \	        V4      RR7      ,          pW2^&   \        V4      # )é   Ú/z/:)Úsafe)r"   r   Úendswithr   Ústrr   )r#   Úadd_onÚ
url_parsedÚpaths   &&  r%   Úcombine_singleÚ#combine_url.<locals>.combine_single<   sZ   € Üœ( 3›-Ó(ˆ
Ø˜!�}ˆß˜Ÿ™ c×*Ò*Ø�C�KˆDØ””c˜&“k¨Ô-Õ-ˆØ�1‰Ü˜*Ó%Ð%r'   © )ÚbaseÚadd_onsr2   r#   r/   s   &*   r%   Úcombine_urlr7   ;   s'   € ò&ð €CÛˆÙ˜SÓ)Šñ à€Jr'   c                ó$   € V ^8„  d   QhR\         /# ©r*   Úreturn©Úint)Úformats   "r%   Ú__annotate__r>   K   s   € ÷ ñ ¬sñ r'   c           
     ót  € \         P                  R\         P                  R\         P                  R\         P                  R\
        R/pVP                  \        V 4      4      pV'       gN   \        V \        4      '       d!   V P                  '       d   V P                  pV# \        P                  R4       RpV# )z4helper for read_ftps to map return codes to a numberé,  é�  éô  iX  i¼  z9Unexpected exception type while connecting to ftp server.i�ÿÿÿ)ÚftplibÚerror_replyÚ
error_tempÚ
error_permÚerror_protoÚEOFErrorÚgetÚtypeÚ
isinstanceÚOSErrorÚerrnoÚLOGÚwarning)ÚexcÚftp_error_codesÚcodes   &  r%   Ú"ftp_get_return_code_from_exceptionrS   K   s—   € ô 	×Ñ˜CÜ×Ñ˜3Ü×Ñ˜3Ü×Ñ˜CÜ�#ð€Oð ×Ñœt C›yÓ)€DßÜ�cœ7×#Ò#¨¯	¯	¨	Ø—9‘9ˆDð €Kô	 �K‰KØKôð ˆDØ€Kr'   c                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r*   r#   ÚtimeoutÚkwargsr:   ÚFtpResponse)r.   ÚfloatÚdict)r=   s   "r%   r>   r>   b   s.   € ÷ ñ ”3ð ¤ð ¼ð Àñ r'   c           
     óÜ  € \        V 4      pVP                  '       g   \        R\        RV R7      h\        P
                  ! 4       ;_uu_ 4       pVP                  ;'       g    ^pVP                  ;'       g    RpRVP                  8X  EdW    \        P                  ! \        4       R7      p\        P                  RV V4       TP                  VP                  TT;'       g    RR	7       \        P                  RT4        TP#                  TTP$                  ;'       g    RR7       \        P                  R4       TP'                  4         \        P                  RTP,                  4       TP/                  RTP,                   2TP0                  R7       \3        TP5                  4       T 4      \        P                  R4       TP7                  4        uuRRR4       #  \        P8                  ! 4       p
\        P                  RW4       T
P                  VP                  TT;'       g    RR	7       \        P                  RV4       T
P#                  TVP$                  ;'       g    RR7       \        P                  RVP,                  4       V
P/                  RVP,                   2VP0                  R7       \3        VP5                  4       V 4      \        P                  R4       V
P7                  4        uuRRR4       #   \        P                   d(   p\!        T4      p	\        R
T  RT	 R2T	RT R7      ThRp?ii ; i  \        P(                   d+   p\        P+                  R4       \        RRRT R7      ThRp?ii ; i  \        P                   d(   p\!        T4      p	\        RT  RT	 R2T	RT R7      ThRp?ii ; i  \        P                  R4       TP7                  4        i ; i  \        P                   d(   p\!        T4      p	\        RT  RT	 R2T	RT R7      ThRp?ii ; i  \        P                  R4       X
P7                  4        i ; i  + '       g   i     R# ; i)aO  connect to URL using ftp over TLS and read a file

when using strict mode (ftps://), raise exception in event of failure
when not using strict mode (ftp://), fall back to using unencrypted ftp

url: string containing the destination to read a file from. The url is
    parsed with urllib.urlsplit to identify username, password, host,
    path, and port in the following format:
        ftps://[username:password@]host[:port]/[path]
    host is the only required component
timeout: maximum time for the connection to take
kwargs: unused, for compatibility with read_url
returns: UrlResponse
zInvalid url providedN©ÚcauserR   Úheadersr#   Ú	anonymousÚftps)Úcontextz3Attempting to connect to %s via port [%s] over tls.ç      @)ÚhostÚportrU   z1Reading file from server over tls failed for url z [Ú]z"Attempting to login with user [%s]r!   )ÚuserÚpasswdzCreating a secure connectionzšAttempted to connect to an insecure ftp server but used a scheme of ftps://, which is not allowed. Use ftp:// to allow connecting to insecure ftp servers.rB   zReading file: %szRETR )ÚcallbackzClosing connectionz,Reading file from ftp server failed for url z(Attempting to connect to %s via port %s.)r   Úhostnamer   r   ÚioÚBytesIOrc   Úusernamer    rC   ÚFTP_TLSr
   rN   ÚdebugÚconnectÚ
all_errorsrS   ÚloginÚpasswordÚprot_prF   rO   r1   Ú
retrbinaryÚwriterW   ÚgetvalueÚcloseÚFTP)r#   rU   rV   Ú	url_partsÚbufferrc   re   Úftp_tlsÚerR   Úftps   &&,        r%   Ú	read_ftpsr}   b   s   € ô  ˜“€IØ××ÐÜØ(¬yÀ$ÈCô
ð 	
ô 
�Š�Œ˜Ø�~‰~×#Ð# ˆØ×!Ñ!×0Ð0 [ˆØ�Y×%Ñ%Õ%ðÜ Ÿ.š.Ü2Ó4ô�ô —	‘	ØIØØôð
 —‘Ø"×+Ñ+ØØ#ŸN˜N sð  ô ô  �I‰IÐ:¸DÔAðØ—‘ØØ$×-Ñ-×3Ð3°ð ô ô —	‘	Ð8Ô9Ø—‘Ô ð" Ü—	‘	Ð,¨i¯n©nÔ=Ø×"Ñ"Ø˜IŸN™NÐ+Ð,°v·|±|ð #ô ô # 6§?¡?Ó#4°cÓ:ô —	‘	Ð.Ô/Ø—‘”÷S 
ŠðVÜ—j’j“l�Ü—	‘	Ø>Àôð —‘Ø"×+Ñ+ØØ#ŸN˜N sð ô ô
 —	‘	Ð>ÀÔEØ—	‘	ØØ$×-Ñ-×3Ð3°ð ô ô —	‘	Ð,¨i¯n©nÔ=Ø—‘  y§~¡~Ð&6Ð7À&Ç,Á,�ÔOÜ" 6§?¡?Ó#4°cÓ:ô —	‘	Ð.Ô/Ø—	‘	”÷U 
Šøô$ ×$Ñ$ô 
Ü9¸!Ó<�Üð*Ø*-¨¨b°°°að9ð Ø Øôð ðûð
ûô& ×$Ñ$ô Ü—‘ðCôô
 ðNð Ø Øô	ð ð	ûðûô. ×$Ñ$ô 
Ü9¸!Ó<�Üð+Ø+.¨%¨r°$°°qð:ð Ø Øôð ðûð
ûô —	‘	Ð.Ô/Ø—‘•ûô( ×$Ñ$ô 
Ü9¸!Ó<�Üð+Ø+.¨%¨r°$°°qð:ð Ø Øôð ðûð
ûô —	‘	Ð.Ô/Ø—	‘	•ú÷U 
�ˆúsÊ   Á)QÁ8QÂALÃ$LÃ,QÄMÄ"-MÅA#NÆ3%QÇ$BO1É,A+O1Ë%QÌMÌ"L>Ì>MÍQÍNÍ%N Î NÎQÎOÎ"N?Î?OÏOÏ'O.Ï.QÏ1P-Ð"P(Ð(P-Ð-P0Ð0'QÑQÑQ+	c                ó(   € V ^8„  d   QhR\         RR/# )r*   r1   r:   ÚFileResponse©r.   )r=   s   "r%   r>   r>   ä   s   € ÷ Mñ M”Sð M ~ñ Mr'   c                ó<  € VP                  R4      '       d   \        P                  RV 4        \        P                  ! V 4      p\        W 4      #   \         d   p\        T\        RT R7      ThRp?i\         d   p\        Y3P                  RT R7      ThRp?ii ; i)zeread a binary file and return a FileResponse

matches function signature with read_ftps and read_url
Údataz'Unable to post data to file resource %sNr[   )rI   rN   rO   r   Úload_binary_filer   ÚFileNotFoundErrorr   r   ÚIOErrorrM   )r1   rV   Úcontentsr{   s   &,  r%   Ú
_read_filer‡   ä   s‡   € ð
 ‡z�z�&×ÒÜ�‰Ð=¸tÔDðMÜ×(Ò(¨Ó.ˆÜ˜HÓ+Ð+øÜô OÜ˜Q¤Y¸À$ÔGÈQÐNûÜô MÜ˜Q§W¡W°dÀÔEÈ1ÐLûðMús)   ¯ A ÁBÁA/Á/BÁ<BÁ=BÂBc                ó2   € V ^8„  d   QhR\         R,          /# )r*   r:   )r   ÚUrlResponserW   )r   )r=   s   "r%   r>   r>   ô   s   € ÷ &ñ &ä
Ð7Õ8ñ&r'   c                óˆ  € V P                  4       p  \        V 4      pTP                  pTR8X  g   T '       d%   RT ^ ,          8X  d   \        TP                  3/ TB # TR9   d   \        T 3/ TB # TR9   d   \        T 3/ TB # \        P                  RT4       \        T 3/ TB #   \         d   p\        Y0R7      ThRp?ii ; i)a   Wrapper function around readurl to allow passing a file path as url.

When url is not a local file path, passthrough any kwargs to readurl.

In the case of parameter passthrough to readurl, default values for some
parameters. See: call-signature of readurl in this module for param docs.
)r\   r#   NÚfiler+   zAttempting unknown protocol %s)r|   r_   )r   Úhttps)Úlstripr   Ú
ValueErrorr   r    r‡   r1   r}   ÚreadurlrN   rO   )r#   rV   Úparsedr{   r    s   &,   r%   Úread_file_or_urlr‘   ô   s¿   € ð �*‰*‹,€Cð0Ü˜#“ˆð �]‰]€FØ�ÔŸC C¨3¨q­6¤MÜ˜&Ÿ+™+Ñ0¨Ñ0Ð0Ø	�?Ô	"Ü˜Ñ' Ñ'Ð'Ø	Ð$Ô	$Ü�sÑ%˜fÑ%Ð%ä�‰Ð4°fÔ=Ü�sÑ%˜fÑ%Ð%øô ô 0Ü˜QÔ(¨aÐ/ûð0ús   ’B$ Â$CÂ/B<Â<Cc                   ó6   a € ] tR tRt o RR ltR tR tRtV tR# )ÚStringResponsei  c                ó8   € W0n         / V n        Wn        W n        R # ©N)rR   r]   r†   r#   )Úselfr†   r#   rR   s   &&&&r%   Ú__init__ÚStringResponse.__init__  s   € ØŒ	ØˆŒØ ŒØŽr'   c                ó    € V P                   ^È8H  # ©éÈ   ©rR   ©r–   ÚargsrV   s   &*,r%   ÚokÚStringResponse.ok  s   € Ø�y‰y˜CÑÐr'   c                ó8   € V P                   P                  R 4      # )zutf-8)r†   Údecode©r–   s   &r%   Ú__str__ÚStringResponse.__str__  s   € Ø�}‰}×#Ñ# GÓ,Ð,r'   )rR   r†   r]   r#   Nrš   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r—   rŸ   r¤   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r%   r“   r“     s   ø‡ € ôò ÷-ð -r'   r“   c                   óB   a a€ ] tR tRt oRV3R lV 3R llltRtVtV ;t# )r   i   c                ó&   <€ V ^8„  d   QhRS[ RS[/# ©r*   r†   r#   ©Úbytesr.   )r=   r­   s   "€r%   r>   ÚFileResponse.__annotate__!  s   ø€ ÷ 3ñ 3¡ð 3©Sñ 3r'   c                ó*   <€ \         SV `  WVR 7       R# )rœ   N©Úsuperr—   )r–   r†   r#   rR   Ú	__class__s   &&&&€r%   r—   ÚFileResponse.__init__!  s   ø€ Ü‰Ñ˜¨TÐÖ2r'   r4   rš   ©r¦   r§   r¨   r©   r—   rª   r«   Ú__classcell__©r·   r­   s   @@r%   r   r      s   ù‡ € ÷3÷ 3õ 3r'   r   c                   ó>   a a€ ] tR tRt oV3R lV 3R lltRtVtV ;t# )rW   i%  c                ó&   <€ V ^8„  d   QhRS[ RS[/# r°   r±   )r=   r­   s   "€r%   r>   ÚFtpResponse.__annotate__&  s   ø€ ÷ (ñ (¡ð (©Sñ (r'   c                ó&   <€ \         SV `  W4       R # r•   rµ   )r–   r†   r#   r·   s   &&&€r%   r—   ÚFtpResponse.__init__&  s   ø€ Ü‰Ñ˜Ö'r'   r4   r¹   r»   s   @@r%   rW   rW   %  s   ù‡ € ÷(÷ (ó (r'   rW   c                   óÈ   a € ] tR tRt o V 3R lR lt]V 3R lR l4       t]V 3R lR l4       tRV 3R lR	 llt]R
 4       t	]V 3R lR l4       t
R tRV 3R lR lltRtV tR# )r‰   i*  c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r*   Úresponse)ÚrequestsÚResponse)r=   r­   s   "€r%   r>   ÚUrlResponse.__annotate__+  s   ø€ ÷ "ñ "¡×!2Ñ!2ñ "r'   c                ó   € Wn         R # r•   ©Ú	_response)r–   rÃ   s   &&r%   r—   ÚUrlResponse.__init__+  s   € Ø!Žr'   c                ó    <€ V ^8„  d   QhRS[ /# r9   )r²   )r=   r­   s   "€r%   r>   rÆ   /  s   ø€ ÷ &ñ &™%ñ &r'   c                ób   € V P                   P                  f   R# V P                   P                  # )Nr'   )rÉ   Úcontentr£   s   &r%   r†   ÚUrlResponse.contents.  s%   € à�>‰>×!Ñ!Ò)ÙØ�~‰~×%Ñ%Ð%r'   c                ó    <€ V ^8„  d   QhRS[ /# r9   r€   )r=   r­   s   "€r%   r>   rÆ   5  s   ø€ ÷ "ñ "‘Sñ "r'   c                ó.   € V P                   P                  # r•   )rÉ   r#   r£   s   &r%   r#   ÚUrlResponse.url4  s   € à�~‰~×!Ñ!Ð!r'   c                ó    <€ V ^8„  d   QhRS[ /# r9   )Úbool)r=   r­   s   "€r%   r>   rÆ   8  s   ø€ ÷ ñ ©ñ r'   c                ó\   € R pV'       d   Rp^ÈV P                   u;8:  d
   V8  d    R#  R# R# )r@   rA   TFrœ   )r–   Úredirects_okÚuppers   && r%   rŸ   ÚUrlResponse.ok8  s-   € ØˆßØˆEØ�$—)‘)Ö#˜eÕ#Ùð $ó r'   c                ó.   € V P                   P                  # r•   )rÉ   r]   r£   s   &r%   r]   ÚUrlResponse.headersA  s   € à�~‰~×%Ñ%Ð%r'   c                ó    <€ V ^8„  d   QhRS[ /# r9   r;   )r=   r­   s   "€r%   r>   rÆ   F  s   ø€ ÷ *ñ *‘cñ *r'   c                ó.   € V P                   P                  # r•   )rÉ   Ústatus_coder£   s   &r%   rR   ÚUrlResponse.codeE  s   € à�~‰~×)Ñ)Ð)r'   c                ó.   € V P                   P                  # r•   )rÉ   Útextr£   s   &r%   r¤   ÚUrlResponse.__str__I  s   € Ø�~‰~×"Ñ"Ð"r'   c                óL   <€ V ^8„  d   QhRS[ S[,          RS[RS[S[,          /# )r*   Ú
chunk_sizeÚdecode_unicoder:   )r   r<   rÓ   r   r²   )r=   r­   s   "€r%   r>   rÆ   L  s2   ø€ ÷ Kñ KÙ"¡3�-ðKÙ=AðKá	‘%�ñKr'   c              #  óX   "  € V P                   P                  W4       Rj  x€L
  R#  L5i)aD  Iterates over the response data.

When stream=True is set on the request, this avoids reading the content
at once into memory for large responses.

:param chunk_size: Number of bytes it should read into memory.
:param decode_unicode: If True, content will be decoded using the best
available encoding based on the response.
N)rÉ   Úiter_content)r–   râ   rã   s   &&&r%   rå   ÚUrlResponse.iter_contentL  s   é € ð —>‘>×.Ñ.¨zÓJ×JÔJùs   ‚*¡(¢*rÈ   N)F)é   F)r¦   r§   r¨   r©   r—   Úpropertyr†   r#   rŸ   r]   rR   r¤   rå   rª   r«   r¬   s   @r%   r‰   r‰   *  s€   ø‡ € ÷"ð "ð ÷&ó ð&ð
 ÷"ó ð"÷ò ð ñ&ó ð&ð ÷*ó ð*ò#÷K÷ Kð Kr'   r‰   c                   ó6   a € ] tR tRt o RV 3R lR lltRtV tR# )r   i[  Nc          	      ób   <€ V ^8„  d   QhRS[ RS[S[,          RS[S[,          RS[S[,          /# )r*   r\   rR   r]   r#   )r   r   r<   r   r.   )r=   r­   s   "€r%   r>   ÚUrlError.__annotate__\  s@   ø€ ÷ ñ áðñ ‘s�mðñ ™'Õ"ð	ñ
 ‘c�]ñr'   c                ó‚   € \         P                  V \        V4      4       Wn        W n        Vf   / MTV n        W@n        R # r•   )r…   r—   r.   r\   rR   r]   r#   )r–   r\   rR   r]   r#   s   &&&&&r%   r—   ÚUrlError.__init__\  s4   € ô 	×Ñ˜œs 5›zÔ*ØŒ
ØŒ	Ø&-¢o¡¸7ˆŒØŽr'   r[   )NNN)r¦   r§   r¨   r©   r—   rª   r«   r¬   s   @r%   r   r   [  s   ø‡ € ÷÷ ð r'   c                 ó$  € / p\        V 4      P                  pVR 8X  dr   V'       dj   RV9   d   VR,          '       d   VR,          VR&   MRVR&   RV9   d   RV9   d   VR,          VR,          .VR&   V# RV9   d   \        VR,          4      VR&   V# )rŒ   Úca_certsÚverifyTÚ	cert_fileÚkey_fileÚcert)r   r    r.   )r#   Ússl_detailsÚssl_argsr    s   &&  r%   Ú_get_ssl_argsrö   j  s    € Ø€HÜ�c‹]×!Ñ!€FØ�ÔŸ[Ø˜Ô$¨°Z×)@Ô)@Ø!,¨ZÕ!8ˆH�XÒà!%ˆH�XÑØ˜+Ô%¨*¸Ô*Cà˜KÕ(Ø˜JÕ'ð ˆH�VÑð €Oð ˜KÔ'Ü" ;¨{Õ#;Ó<ˆH�VÑØ€Or'   c                ó0   € V ^8„  d   QhR\         R\        /# )r*   Úretry_afterr:   )r.   rX   )r=   s   "r%   r>   r>   |  s   € ÷ !ñ !¤#ð !¬%ñ !r'   c                ó’  €  \        V 4      pV#   \         d­   p \        T 4      pT'       g   \        R4      Th\        \        P                  ! T4      \        P                  ! 4       ,
          4      pM)  \         d    \
        P                  RT 4       ^p Mi ; iT^ 8  d   \
        P                  R4       ^p Rp?T# Rp?ii ; i)a(  Parse a Retry-After header value into an integer.

: param retry_after: The value of the Retry-After header.
    https://www.rfc-editor.org/rfc/rfc9110.html#section-10.2.3
    https://www.rfc-editor.org/rfc/rfc2616#section-3.3
: return: The number of seconds to wait before retrying the request.
z(Failed to parse Retry-After header valuezGFailed to parse Retry-After header value: %s. Waiting 1 second instead.zBRetry-After header value is in the past. Waiting 1 second instead.N)rX   rŽ   r   ÚtimeÚmktimerN   Úinfo)rø   Úto_waitrP   Ú
time_tuples   &   r%   Ú_get_retry_afterrÿ   |  sÀ   € ðÜ˜Ó$ˆð0 €Nøô/ ô ð	Ü" ;Ó/ˆJßÜ Ø>óàðô œDŸKšK¨
Ó3´d·i²i³kÕAÓB‰GøÜô 	Ü�H‰Hð,àôð
 ŠGð	úð �QŒ;Ü�H‰Hð,ôð ˆGûØ€Nûð/ús3   ‚ �C›AA4Á3CÁ4#BÂCÂBÂ!CÃCÚexception_cbc                óR   € V ^8„  d   QhR\         R\        R\        \        ,          /# )r*   Úerrorr   r:   )r   ÚExceptionCallbackr   rX   )r=   s   "r%   r>   r>      s,   € ÷  ñ  Üð ô $ð ô Œe…_ñ	 r'   c               ól  € V'       d   V! V 4      '       d   R# V P                   '       d€   V P                   R8X  do   \        P                  RV P                  4       V P                  '       d&   \        V P                  P                  RR4      4      # \        P                  R4       ^# V'       g   R# V h)a¶  Handle exceptions raised during request processing.

If we have no exception callback or the callback handled the error or we
got a 503, return with an optional timeout so the request can be retried.
Otherwise, raise the error.

:param error: The exception raised during the request.
:param response: The response object.
:param exception_cb: Callable to handle the exception.

:return: Optional time to wait before retrying the request.
Ni÷  zNEndpoint returned a 503 error. HTTP endpoint is overloaded. Retrying URL (%s).zRetry-AfterÚ1z7Unable to introspect response header. Waiting 1 second.)rR   rN   rO   r#   r]   rÿ   rI   rü   )r  r   s   &$r%   Ú_handle_errorr     s‚   € ÷" ™ U×+Ò+ÙØ‡z‡z€z�e—j‘j CÔ'Ü�‰ð>à�I‰Iô	
ð
 �=�=ˆ=Ü# E§M¡M×$5Ñ$5°mÀSÓ$IÓJÐJÜ�‰ÐJÔKÙßÙà
€Kr'   r‚   rU   ÚretriesÚsec_betweenr]   Ú
headers_cbÚheaders_redactrô   Úcheck_statusTÚallow_redirectsÚsessionÚinfiniteFÚlog_req_respÚrequest_methodr!   Ústreamc                ó<   € V ^8„  d   QhR\         R\        R\        /# )r*   r   r  r:   )r  rÓ   r‰   )r=   s   "r%   r>   r>   Ã  s/   € ÷ m=ñ m=ô $ðm=ô$ ð%m=ô& ñ'm=r'   c          	     ó‚  € \        V 4      p RV RV/pVP                  \        W4      4       V
VR&   V'       g   V'       d   RMRpVVR&   Ve5   \        V\        4      '       d   VVR&   M\        \        V4      ^ 4      VR&   Vf   . p^pV'       d   \        \        V4      ^,           ^4      pR	\        P                  ! 4       ,          pVe   VP                  4       pM/ pV'       d   VVR
&   Vf   RpVf   \        P                  ! 4       p\        4        EFc  pV'       d	   V! V 4      pRV9  d   VVR&   VVR&   / pVP                  4        F‹  w  ppVR
8X  d   K  VR8X  dq   V'       di   V Uu. uF  pVP                  V4      '       g   K  VNK   	  ppV'       d5   \        P                   ! V4      VX&   V F  p\"        VV,          V&   K  	  K„  K†  VVV&   K�  	   V'       d$   \$        P'                  RTV'       d   RMTV V4       VP(                  ! R/ VB pV	'       d   VP+                  4        \$        P'                  RV VP,                  \/        VP0                  4      V^,           4       \3        V4      u # 	  \I        R4      hu upi   \4        P6                   d   p\9        TT R7      ThRp?i\4        P:                   dD   p\9        TTP<                  P,                  TP<                  P>                  T R7      pTp Rp?M6Rp?i\4        P@                   d   p\9        TT R7      pTpRp Rp?MRp?ii ; i\C        TTR7      pT'       g"   T;'       g    T^,           T8  pT'       g   TThT;'       g    Tp T^ 8”  g   EKs  T'       d   \$        P'                  RT4       \D        PF                  ! T 4       EKª  )aä  Wrapper around requests.Session to read the url and retry if necessary

:param url: Mandatory url to request.
:param data: Optional form data to post the URL. Will set request_method
    to 'POST' if present.
:param timeout: Timeout in seconds to wait for a response. May be a tuple
    if specifying (connection timeout, read timeout).
:param retries: Number of times to retry on exception if exception_cb is
    None or exception_cb returns True for the exception caught. Default is
    to fail with 0 retries on exception.
:param sec_between: Default 1: amount of seconds passed to time.sleep
    between retries. None or -1 means don't sleep.
:param headers: Optional dict of headers to send during request
:param headers_cb: Optional callable returning a dict of values to send as
    headers during request
:param headers_redact: Optional list of header names to redact from the log
:param ssl_details: Optional dict providing key_file, ca_certs, and
    cert_file keys for use on in ssl connections.
:param check_status: Optional boolean set True to raise when HTTPError
    occurs. Default: True.
:param allow_redirects: Optional boolean passed straight to Session.request
    as 'allow_redirects'. Default: True.
:param exception_cb: Optional callable to handle exception and returns
    True if retries are permitted.
:param session: Optional exiting requests.Session instance to reuse.
:param infinite: Bool, set True to retry indefinitely. Default: False.
:param log_req_resp: Set False to turn off verbose debug messages.
:param request_method: String passed as 'method' to Session.request.
    Typically GET, or POST. Default: POST if data is provided, GET
    otherwise.
:param stream: if False, the response content will be immediately
downloaded.
r#   r  r  ÚPOSTÚGETÚmethodNrU   zCloud-Init/%sr‚   z
User-Agentr]   z'[%s/%s] open '%s' with %s configurationr  z(Read from %s (%s, %sb) after %s attempts)r#   ©rR   r]   r#   ©r   ú1Please wait %s seconds while we wait to try againz"This path should be unreachable...éÿÿÿÿr4   )%r&   Úupdaterö   rK   ÚtupleÚmaxrX   r<   r   Úversion_stringÚcopyrÄ   ÚSessionr	   ÚitemsrI   Údeepcopyr   rN   rm   ÚrequestÚraise_for_statusrÜ   ÚlenrÍ   r‰   r   ÚSSLErrorr   Ú	HTTPErrorrÃ   r]   ÚRequestExceptionr  rú   ÚsleepÚRuntimeError)!r#   r‚   rU   r  r  r]   r	  r
  rô   r  r  r   r  r  r  r  r  Úreq_argsÚmanual_triesÚ
user_agentÚiÚfiltered_req_argsÚkÚvÚmatched_headersÚkeyrÃ   r{   Ú	url_errorÚraised_exceptionÚresponse_sleep_timeÚ
will_retryÚ
sleep_times!   &$$$$$$$$$$$$$$$$                r%   r�   r�   Ã  sg  € ôj �C‹.€CàˆsØ�&ð€Hð ‡O�O”M #Ó3Ô4Ø"1€HÐÑßß#'™¨UˆØ'€HˆXÑØÒÜ�gœu×%Ò%Ø")ˆH�YÒä"%¤e¨G£n°aÓ"8ˆH�YÑØÒØˆØ€LßÜœ3˜w›<¨!Õ+¨QÓ/ˆà ¤G×$:Ò$:Ó$<Õ=€JØÒØ—,‘,“.‰àˆçØˆ�ÑØÒØˆà‚Ü×"Ò"Ó$ˆô �WˆßÙ  “oˆGà˜wÔ&Ø$.ˆG�LÑ!à%ˆ�ÑØÐØ—N‘NÖ$‰DˆAˆqØ�FŒ{ÙØ�IŒ~§.Ù.<Ó"I©n¨ÀÇÁÀaÇ§1 1©n�Ð"Iß"Ü+/¯=ª=¸Ó+;Ð% aÑ(Û.˜Ü4<Ð)¨!Õ,¨SÓ1ó  /ñ #ð
 ()Ð! !Ó$ñ %ð(	ßÜ—	‘	Ø=Øß"*‘J°ØØ%ôð —’Ñ2¨Ñ2ˆHçØ×)Ñ)Ô+Ü�I‰IØ:ØØ×$Ñ$Ü�H×$Ñ$Ó%Ø�Q•ôô ˜xÓ(Ò(ñ[ ôf Ð;Ó
<Ð<ùòM #JøôB ×"Ñ"ô 	.ô ˜1 #Ô&¨AÐ-ûÜ×#Ñ#ô 	!Ü ØØ—Z‘Z×+Ñ+ØŸ
™
×*Ñ*Øô	ˆIð  !ÕûÜ×*Ñ*ô 	Ü  ¨Ô,ˆIØ ÐØ�Hûð	úô
 ,ØØ%ô
Ð÷ #Ø!×;Ð; a¨!¥e¨lÑ&:ˆJßØÐ%5Ð5Ø(×7Ð7¨Kˆ
à˜�?ßÜ—	‘	ØGØôô �JŠJ�z×"s[   Å0J
ÆJ
ÇJÇ&JÇ?#JÈ#AJÊL;Ê$J2Ê2L;Ë	L;Ë
9LÌL;ÌL;Ì L6Ì6L;c                ó¤   € V ^8„  d   QhR\         R\        3,          R\        R\        R\        P
                  R\        \        ,          R\        /# )r*   Úfunc.ÚaddrrU   ÚeventÚdelayr:   )r   r   r.   r<   Ú	threadingÚEventr   rX   )r=   s   "r%   r>   r>   s  sU   € ÷ ñ Ü
�3œ�8Õ
ðä
ðô ðô �?‰?ð	ô
 ”E�?ðô 	ñr'   c                óV   € V'       d   VP                  VR7      '       d   R# V ! W4      # )z Execute func with optional delay©rU   N©Úwait©r:  r;  rU   r<  r=  s   &&&&&r%   Ú_run_func_with_delayrE  s  s(   € ÷ ð
 �:‰:˜eˆ:×$Ò$ÙÙ�ÓÐr'   ç333333Ã?c                óÒ   € V ^8„  d   QhR\         R\        3,          R\        \        ,          R\        R\
        R\        \        \        ,          \        \        ,          3,          /# )r*   r:  .Ú	addressesÚstagger_delayrU   r:   )	r   r   r   r.   rX   r<   r   r   r‰   )r=   s   "r%   r>   r>   …  sa   € ÷ P-ñ P-Ü
�3œ�8Õ
ðP-ä”C�yðP-ô ðP-ô ð	P-ô
 Œ8”C�=œ(¤;Õ/Ð/Õ0ñP-r'   c                ó†  € RpRpRp. p\         P                  ! 4       p\        \        V4      R7      p	 \	        V4       U
Uu/ uF'  w  r«V	P                  \        V VVVW¢,          R7      VbK)  	  pp
p\        WÃR7       Fx  pWÍ,          pVP                  4       pV'       d   TpVP                  ! V4       K9  VP                  4       pV'       g   KS  VP                  4        WT3u V	P                  RR7       # 	  V'       d   \        P                  RVV4       Vh\        P                  RV4       \!        R	4      hu upp
i   \"         dG    \        P                  R
RP%                  T4      RP%                  \'        \(        T4      4      4        Mi ; i T	P                  RR7       YT3#   T	P                  RR7       i ; i)a  execute multiple callbacks in parallel

Run blocking func against two different addresses staggered with a
delay. The first call to return successfully is returned from this
function and remaining unfinished calls are cancelled if they have not
yet started
N)Úmax_workersrD  rA  FrB  z<Exception(s) %s during request to %s, raising last exceptionzEmpty result for address %szNo result returnedzJTimed out waiting for addresses: %s, exception(s) raised while waiting: %sÚ )r>  r?  r   r%  Ú	enumerateÚsubmitrE  r   Ú	exceptionÚappendÚresultÚsetÚshutdownrN   rm   r  rŽ   r   ÚjoinÚmapr.   )r:  rH  rI  rU   Úreturn_resultÚreturned_addressÚlast_exceptionr   Úis_doneÚexecutorr.  r;  ÚfuturesÚfutureÚreturn_exceptions   &&&&           r%   Ú
dual_stackr^  …  sÈ  € ð €MØÐØ.2€NØ€JÜ�oŠoÓ€Gô "¬c°)«nÔ=€Hð5&ô % YÔ/ô

ñ 0‘�ð �O‰OÜ$ØØØØØÕ(ð ó ð òñ 0ð 	ñ 

ô # 7×<ˆFà&�ÐØ%×/Ñ/Ó1ÐßØ!1�Ø×!Ò! .Ö1à &§¡£�ß ‘=ð —K‘K”MØ,Ð<Ñ<ð2 	×Ñ˜uÐÕ%ñO =÷$ Ü�I‰Ið-àØ ô	ð !Ð ä�I‰IÐ3Ð5EÔFÜÐ1Ó2Ð2ùóS

øôX ô 
Ü�	‰	ð4à�H‰H�YÓØ�H‰H”Sœ˜jÓ)Ó*ö		
ð
úð	
ð 	×Ñ˜uÐÔ%àÐ,Ð,øð 	×Ñ˜uÐÕ%úsD   ´E Á-D<Á/AE ÃE Ã8	E ÄA E ÅAFÆF, ÆFÆF, Æ,G c                   ó,   a € ] tR tRt o V 3R ltRtV tR# )ÚHandledResponseiØ  c                ón   <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[ S[,          ;R&   # )r*   r#   rÃ   Ú	wait_time)r   r.   r‰   rX   )r=   r­   s   "€r%   r>   ÚHandledResponse.__annotate__Ø  s7   ø‡ ‚ á	‘#�Ññ ñ ‘{Õ#Ñ#ñ ñ ™�Ñò r'   r4   N)r¦   r§   r¨   r©   Ú__annotate_func__rª   r«   r¬   s   @r%   r`  r`  Ø  s   ø‡ ‡ „ r'   r`  Úmax_waitÚinfÚ	status_cbr8  Úsleep_time_cbÚconnect_synchronouslyÚasync_delayc                ó  € V ^8„  d   QhR\         R\        \         ,          R\        R\        \        ,          R\        \         ,          R\        R\        \        \        \         .\         3,          ,          R\
        R	\        R
\         /
# )r*   re  rU   rg  r	  r8  r   rh  r  ri  rj  )rX   r   r   r  r   r.   rÓ   )r=   s   "r%   r>   r>   á  sœ   € ÷ |ñ |ô ð|ô ”e�_ð	|ô
 ð|ô œÕ"ð|ô œ•ð|ô $ð|ô œH¤c¬5 \´5Ð%8Õ9Õ:ð|ô ð|ô  ð|ô ñ|r'   c               óŠ  a aaaaa	aaaaaaa€ R V3R llpRR R lloR R loR VV3R lloR	 VVV	3R
 lloR VVVVVVV 3R llpR VVVV 3R llp\         P                  ! 4       pS'       d   V'       d   \        R4      hV
'       d   TMTpT;'       g    Tp^ oRp V! WòWs4      pRoVP                  '       d#   VP                  VP                  P
                  3# VP                  '       d.   \         P                  ! VP                  4       S^,           oRoK  V! VS4      pS! SVV4      '       d    R# S^,           o\        P                  RV4       \         P                  ! V4       \         P                  ! 4       pV'       g   Kï  VV,           VS,           8”  g   EK  SVV,
          ,
          pV^ 8:  g   EK!   R# )a¡  Wait for a response from one of the urls provided.

:param urls: List of urls to try
:param max_wait: Roughly the maximum time to wait before giving up
    The max time is *actually* len(urls)*timeout as each url will
    be tried once and given the timeout provided.
    a number <= 0 will always result in only one try
:param timeout: Timeout provided to urlopen
:param status_cb: Callable with string message when a url is not available
:param headers_cb: Callable with single argument of url to get headers
    for request.
:param headers_redact: List of header names to redact from the log
:param sleep_time: Amount of time to sleep between retries. If this and
    sleep_time_cb are None, the default sleep time defaults to 1 second
    and increases by 1 seconds every 5 tries. Cannot be specified along
    with `sleep_time_cb`.
:param exception_cb: Callable to handle exception and returns True if
    retries are permitted.
:param sleep_time_cb: Callable with 2 arguments (response, loop_n) that
    generates the next sleep time. Cannot be specified
    along with 'sleep_time`.
:param request_method: Indicates the type of HTTP request:
    GET, PUT, or POST
:param connect_synchronously: If false, enables executing requests
    in parallel
:param async_delay: Delay before parallel metadata requests, see RFC 6555

:return: tuple of (url, response contents), on failure, (False, None)

:raises: UrlError on unrecoverable error
c                ó0   € V ^8„  d   QhR\         R\        /# )r*   Úloop_numberr:   )r<   rX   )r=   s   "r%   r>   Ú"wait_for_url.<locals>.__annotate__  s   € ÷ Nñ N¬3ð N´5ñ Nr'   c                 ó0   <€ Se   S# V^,          ^,           # r•   r4   )Ú_rn  r8  s   &&€r%   Údefault_sleep_timeÚ(wait_for_url.<locals>.default_sleep_time  s   ø€ Ø'Ò3ˆzÐM¸ÈÕ9IÈAÕ9MÐMr'   c                ó<   € V ^8„  d   QhR\         R\         R\         /# )r*   re  Ú
start_timer8  )rX   )r=   s   "r%   r>   ro    s!   € ÷ 
ñ 
œð 
¬Eð 
¼uñ 
r'   c                ó�   € V \        R4      R39   d   R# V ^ 8*  ;'       g'    \        P                  ! 4       V,
          V,           V 8„  # )z4Check if time is up based on start time and max waitrf  NF)rX   rú   Ú	monotonic)re  ru  r8  s   &&&r%   ÚtimeupÚwait_for_url.<locals>.timeup  sE   € àœ˜e› dÐ+Ô+ÙØ˜A‘÷ 
ð 
Ü�NŠNÓ˜zÕ)¨JÕ6¸ÑAð	
r'   c                ó    € V ^8„  d   QhR\         \        ,          R\         \        ,          R\        \         \        ,          \        3,          /# )r*   rÃ   r#   r:   )r   r‰   r.   r   r   )r=   s   "r%   r>   ro    s<   € ÷ '!ñ '!Üœ;Õ'ð'!Ü.6´s­mð'!ä	ŒxœÕ!¤3Ð&Õ	'ñ'!r'   c                óÊ  € RpRpV '       d	   V'       g   Rp\        \        V4      4      pW23#  V P                  P                  4        T P                  '       gC   RT P                  ,          p\        \        T4      T P                  T P                  TR7      pY23# T P                  4       '       g@   RT P                  ,          p\        \        T4      T P                  T P                  TR7      pY23#   \        P
                  P                   dO   p\        TTP                  P                  TP                  P                  TR7      pT\        T4      3u Rp?# Rp?ii ; i)z?Map requests response code/contents to internal "UrlError" typer!   NzRequest timed outr  zempty response [%s]zbad status code [%s])r   rŽ   rÉ   r$  rÄ   r   r'  rÃ   rÜ   r]   r.   r†   rR   rŸ   )rÃ   r#   ÚreasonÚurl_excr{   s   &&   r%   Úhandle_url_responseÚ)wait_for_url.<locals>.handle_url_response  s7  € ð ˆØˆßŸSØ(ˆFÜœz¨&Ó1Ó2ˆGØ�?Ð"ð	#ð ×Ñ×/Ñ/Ô1ð × × Ð Ø*¨h¯m©mÕ<ˆFÜÜ˜6Ó"Ø—]‘]Ø ×(Ñ(Øô	ˆGð Ð Ð ð —‘—’à+¨x¯}©}Õ=ˆFÜÜ˜6Ó"Ø—]‘]Ø ×(Ñ(Øô	ˆGð Ð Ð øô3 ×"Ñ"×,Ñ,ô 	#ÜØØ—Z‘Z×+Ñ+ØŸ
™
×*Ñ*Øô	ˆGð œC ›F�?Õ"ûð	#ús   ¯C5 Ã5E"ÄAEÅE"ÅE"c                ó
  € V ^8„  d   QhR\         \        .\        \        \        ,          \        \
        ,          3,          3,          R\        \        \        \        ,          3,          R\        R\        R\         R\        /# )r*   Úurl_reader_cbÚurlsru  Úexc_cbÚlog_cbr:   )r   r   r   r   r.   r‰   r   r   r<   r  r`  )r=   s   "r%   r>   ro  D  su   € ÷ *
ñ *
ÜÜˆE”5œ¤#�¬´Õ(=Ð=Õ>Ð>õ
ð*
ô ”Cœœc��NÕ#ð	*
ô
 ð*
ô "ð*
ô ð*
ô 
ñ*
r'   c           	     ó  <€ RpRp V ! V4      w  rgS! Wv4      w  r…V'       g   \        WgRR7      #  \        \        P
                  ! 4       V,
          4      p
S'       d
   RS,          MRpRT;'       g    \        VR	R	4      : R
V
: RV: RV: 2pV! V4       \        RR\        V\        4      '       d   \        WƒR7      R7      # RR7      #   \         d   p	RT	,          pT	p Rp	?	L·Rp	?	i\         d   p	RT	,          pT	p Rp	?	LÕRp	?	ii ; i)z:Execute request, handle response, optionally log exceptionr!   N)rb  zrequest error [%s]zunexpected error [%s]z%ssÚ	unlimitedz	Calling 'r#   z
' failed [r+   z]: r  ©r#   rÃ   rb  )	r`  r   Ú	Exceptionr<   rú   rw  ÚgetattrrK   r  )r�  r‚  ru  rƒ  r„  r|  r#   rÃ   r}  r{   Ú
time_takenÚmax_wait_strÚ
status_msgr~  re  s   &&&&&        €€r%   Úread_url_handle_exceptionsÚ0wait_for_url.<locals>.read_url_handle_exceptionsD  s  ø€ ð ˆØˆð
	Ù)¨$Ó/‰MˆCÙ1°(Ó@‰OˆGßÜ& sÀÔEÐEð ô œŸšÓ)¨JÕ6Ó7ˆ
ß+3�u˜xÖ'¸‰à×1Ð1”7˜7 E¨5Ó1Ò1ÛÛÚð	
ˆ
ñ 	ˆzÔäØØô ˜g¤x×0Ò0ô ˜gÔ;ô	
ð 	
ð ô
ð 	
øô! ô 	Ø)¨AÕ-ˆFØ�GûÜô 	Ø,¨qÕ0ˆFØ�Gûð	ús)   ‡(C ÃDÃC(Ã(DÃ5DÃ6DÄDc                ó<   € V ^8„  d   QhR\         R\        R\        /# )r*   r#   rU   r:   )r.   r<   r‰   )r=   s   "r%   r>   ro  p  s!   € ÷ 
ñ 
œð 
¤sð 
¬{ñ 
r'   c           	      ó>   <€ \        T Sf   / MS! V 4      SVRSR7      # )NF)r]   r
  rU   r  r  )r�   )r#   rU   r	  r
  r  s   &&€€€r%   Úread_url_cbÚ!wait_for_url.<locals>.read_url_cbp  s-   ø€ ÜØØ$Ò,‘B±*¸S³/Ø)ØØØ)ô
ð 	
r'   c                ó$   € V ^8„  d   QhR\         /# r9   ©r`  )r=   s   "r%   r>   ro  z  s   € ÷ "Mñ "Mä	ñ"Mr'   c                ó  <a€ R VV3R llp. pS FÏ  p\         P                  ! 4       pS
^ 8w  db   S'       gZ   S! SV 4      '       d   \        RRRR7      u # Se7   S'       d/   VS,           V S,           8”  d   \        V S,           V,
          4      oS! WFWV4      pVP                  '       d   Vu # VP
                  '       g   K´  VP                  VP
                  4       KÑ  	  V'       d   \        V4      MRp	\        RRV	R7      # )zliterate over list of urls, request each one and handle responses
and thrown exceptions individually per url
c                ó$   € V ^8„  d   QhR\         /# )r*   r#   r€   )r=   s   "r%   r>   Ú;wait_for_url.<locals>.read_url_serial.<locals>.__annotate__�  s   € ÷ 	4ñ 	4¤3ñ 	4r'   c                 ó   <€ V S! V S4      3# r•   r4   )r#   r‘  rU   s   &€€r%   Úurl_reader_serialÚ@wait_for_url.<locals>.read_url_serial.<locals>.url_reader_serial�  s   ø€ Ø™ S¨'Ó2Ð3Ð3r'   Nr‡  )rú   rw  r`  r<   rÃ   rb  rP  r  )ru  rU   rƒ  r„  r™  Ú
wait_timesr#   ÚnowÚoutrb  Úloop_nre  Úmust_try_againr‘  r�  rx  r‚  s   &f&&      €€€€€€€r%   Úread_url_serialÚ%wait_for_url.<locals>.read_url_serialz  sà   ù€ ÷	4ñ 	4ð ˆ
ÛˆCÜ—.’.Ó"ˆCØ˜Œ{§>Ù˜( J×/Ò/Ü*Ø ¨4¸4ôò ð Ò(ßØ˜w�¨*°xÕ*?Ô@ô " :°Õ#8¸CÕ"?Ó@�Gá,Ø!¨
¸FóˆCð �|�|ˆ|Ø’
Ø——’Ø×!Ñ! #§-¡-Ö0ñ+ ÷, (2”C˜
”O°tˆ	Ü 4°$À)ÔLÐLr'   c                ó$   € V ^8„  d   QhR\         /# r9   r”  )r=   s   "r%   r>   ro  ž  s   € ÷ 
ñ 
ä	ñ
r'   c                ó@   <€ \        \        SSVR7      pS! VSWV4      # )z�pass list of urls to dual_stack which sends requests in parallel
handle response and exceptions of the first endpoint to respond
)rI  rU   )r   r^  )	ru  rU   rƒ  r„  Úurl_reader_parallelrj  r‘  r�  r‚  s	   &&&& €€€€r%   Úread_url_parallelÚ'wait_for_url.<locals>.read_url_parallelž  s4   ø€ ô &ÜØØ%Øô	
Ðñ *Ø  z¸6ó
ð 	
r'   z3sleep_time and sleep_time_cb are mutually exclusiveNTFr  )r   )FN)
rú   rw  rŽ   rÃ   r#   r†   rb  r)  rN   rm   )r‚  re  rU   rg  r	  r
  r8  r   rh  r  ri  rj  rr  r   r¥  ru  Údo_read_urlÚcalculate_sleep_timerÃ   ÚrespÚcurrent_sleep_timeÚcurrent_timer~  rž  rŸ  r‘  r�  rx  s   fd$$ddd$$d$d          @@@@@@r%   Úwait_for_urlr¬  á  sˆ  ÿü€ ÷^Nð N÷
õ'!÷R*
ñ *
÷X
ò 
÷"Mö "M÷H
ó 
ô  —’Ó!€Jß—mÜÐNÓOÐO÷ 1‰Ð6Gð ð )×>Ð>Ð,>Ðà€FØ€HØ
Ù˜:°ÓHˆØˆØ�=�=ˆ=Ø—8‘8˜TŸ]™]×3Ñ3Ð3Ð3Ø�^�^ˆ^Ü�JŠJ�t—~‘~Ô&Ø˜a•ZˆFØ!ˆNÙá1°(¸FÓCÐÙ�(˜JÐ(:×;Ò;Øð" Ðð ˜!•ˆÜ�	‰	Ø?Øô	
ô 	�
Š
Ð%Ô&ô —~’~Ó'ˆß‰7�| gÕ-°
¸XÕ0E×EØ ,°Õ";Õ<ˆGØ˜!�|ààÐr'   c                   ó`   a € ] tR tRt o RR ltR tR tR tR tR t	R	 t
R
 tR tR tRtV tR# )ÚOauthUrlHelperià  Nc                óf  € Wn         T;'       g    R V n        W n        W0n        WPn        RV n        ^V n        V P                  V P                  V P                   3p\        V4      '       g	   RV n        M\        V4      '       g   \        R4      hV P                  4       pT;'       g    / V n        R# )r!   TFzBall or none of token_key, token_secret, or consumer_key can be setN)Úconsumer_keyÚconsumer_secretÚ	token_keyÚtoken_secretÚskew_data_fileÚ	_do_oauthÚskew_change_limitÚanyÚallrŽ   Úread_skew_fileÚ	skew_data)r–   r°  r²  r³  r±  r´  ÚrequiredÚolds   &&&&&&  r%   r—   ÚOauthUrlHelper.__init__á  sž   € ð )ÔØ.×4Ð4°"ˆÔØ"ŒØ(ÔØ,ÔØˆŒØ!"ˆÔØ—N‘N D×$5Ñ$5°t×7HÑ7HÐIˆÜ�8�}Š}Ø"ˆD�NÜ�X—’Üð*óð ð
 ×!Ñ!Ó#ˆØŸ˜ ˆŽr'   c           	     óÖ  € V P                   '       d¦   \        P                  P                  V P                   4      '       dw   \        P
                  ! R V P                    24      ;_uu_ 4        \        V P                   RR7      ;_uu_ 4       p\        P                  ! V4      uuRRR4       uuRRR4       # R#   + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)zReading Úr©ÚmodeN)	r´  Úosr1   Úisfiler   ÚTimedÚopenÚjsonÚload)r–   Úfps   & r%   r¹  ÚOauthUrlHelper.read_skew_fileü  s§   € Ø××Ð¤2§7¡7§>¡>°$×2EÑ2E×#FÒ#FÜ×"Ò" X¨d×.AÑ.AÐ-BÐ#C×DÕDÄdØ×#Ñ#¨#÷Gõ GàÜ—y’y “}÷Gñ G×DÒDñ ÷	G÷ Gú×Dñ ÷	 EÖDñ ús$   Á- CÂB:	Â#
CÂ:C
ÃCÃC(	c           	     ó²  € V P                   '       g   R # V P                  4       pVf   / pW#V&   \        P                  ! RV P                    24      ;_uu_ 4        \	        V P                   RR7      ;_uu_ 4       pVP                  \        P                  ! V4      4       R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i)NzWriting ÚwrÀ  )r´  r¹  r   rÄ  rÅ  rt   rÆ  Údumps)r–   rb   ÚvalueÚcurrÈ  s   &&&  r%   Úupdate_skew_fileÚOauthUrlHelper.update_skew_file  s¢   € à×"×"Ð"ÙØ×!Ñ!Ó#ˆØŠ;ØˆCØˆD‰	Ü×Ò ¨$×*=Ñ*=Ð)>Ð?×@Õ@Ä$Ø×Ñ c÷C
õ C
àØ�H‰H”T—Z’Z “_Ô%÷C
×@Ñ@÷ C
÷ C
ú×@×@Ð@ús$   Á CÁ:&B2	Â CÂ2CÂ=CÃC	c                ó  € \        V\        4      '       d#   VP                  R 8X  g   VP                  R8X  g   R# RVP                  9  d#   \        P                  RVP                  4       R# VP                  R,          p \        P                  ! \        V4      4      p\        T\        P                  ! 4       ,
          4      p\        TP                  4      P                  pT P                  P                  T^ 4      p\!        Yu,
          4      T P"                  8”  d(   T P%                  Ye4       \        P                  RYe4       YPP                  T&   R#   \         d"   p\        P                  RY$4        Rp?R# Rp?ii ; i)i“  i‘  NÚdatez$Missing header 'date' in %s responsez#Failed to convert datetime '%s': %sz$Setting oauth clockskew for %s to %d)rK   r   rR   r]   rN   rO   rú   rû   r   rˆ  r<   r   r#   Únetlocrº  rI   Úabsr¶  rÏ  )r–   rO  rÒ  Úremote_timer{   Úskewrb   Úold_skews   &&      r%   r   ÚOauthUrlHelper.exception_cb  s  € ä�y¤(×+Ò+Ø—‘ 3Ô&¨)¯.©.¸CÔ*?áà˜×*Ñ*Ô*Ü�K‰KÐ>À	ÇÁÔOÙà× Ñ  Õ(ˆð	ÜŸ+š+¤i°£oÓ6ˆKô
 �;¤§¢£Õ,Ó-ˆÜ˜	Ÿ™Ó&×-Ñ-ˆØ—>‘>×%Ñ% d¨AÓ.ˆÜˆx�Ó $×"8Ñ"8Ô8Ø×!Ñ! $Ô-Ü�K‰KÐ>ÀÔKØ#�‰�tÑáøô ô 	Ü�K‰KÐ=¸tÔGÝûð	ús   ÂE ÅFÅ#E?Å?Fc           	     óz  € V P                   '       g   / # R p\        V4      P                  pV P                  '       dG   W0P                  9   d7   \	        \
        P
                  ! 4       4      V P                  V,          ,           p\        VV P                  V P                  V P                  V P                  VR7      # )N)r#   r°  r²  r³  r±  Ú	timestamp)rµ  r   rÓ  rº  r<   rú   Úoauth_headersr°  r²  r³  r±  )r–   r#   rÚ  rb   s   &&  r%   r	  ÚOauthUrlHelper.headers_cb-  s‰   € Ø�~�~ˆ~ØˆIàˆ	Ü˜‹}×#Ñ#ˆØ�>�>ˆ>˜d§n¡nÔ4ÜœDŸIšI›KÓ(¨4¯>©>¸$Õ+?Õ?ˆIäØØ×*Ñ*Ø—n‘nØ×*Ñ*Ø ×0Ñ0Øô
ð 	
r'   c                ó²   € \        V P                  VP                  R 4      4      VR &   \        V P                  VP                  R4      4      VR&   V! V/ VB # )r	  r   )r   Ú_headers_cbrI   Ú_exception_cb)r–   Úwrapped_funcrž   rV   s   &&&&r%   Ú_wrappedÚOauthUrlHelper._wrapped?  s\   € Ü&Ø×Ñ˜fŸj™j¨Ó6ó 
ˆˆ|Ñô ")Ø×Ñ §
¡
¨>Ó :ó"
ˆˆ~Ññ ˜TÐ, VÑ,Ð,r'   c                ó.   € V P                  \        W4      # r•   )rá  r¬  r�   s   &*,r%   r¬  ÚOauthUrlHelper.wait_for_urlH  s   € Ø�}‰}œ\¨4Ó8Ð8r'   c                ó.   € V P                  \        W4      # r•   )rá  r�   r�   s   &*,r%   r�   ÚOauthUrlHelper.readurlK  s   € Ø�}‰}œW dÓ3Ð3r'   c                óz   € R p V'       d	   V! V4      pV P                  V4       V#   T P                  T4       i ; i)Tr  )r–   Úextra_exception_cbrO  Úrets   &&& r%   rß  ÚOauthUrlHelper._exception_cbN  s>   € Øˆð	)ß!Ù(¨Ó3�à×Ñ˜iÔ(Øˆ
øð ×Ñ˜iÕ(ús   „' Œ' §:c                ój   € / pV'       d	   V! V4      pVP                  V P                  V4      4       V# r•   )r  r	  )r–   Úextra_headers_cbr#   r]   s   &&& r%   rÞ  ÚOauthUrlHelper._headers_cbW  s.   € ØˆßÙ& sÓ+ˆGØ�‰�t—‘ sÓ+Ô,Øˆr'   )rµ  r°  r±  r¶  rº  r´  r²  r³  )NNNNz/run/oauth_skew.json)r¦   r§   r¨   r©   r—   r¹  rÏ  r   r	  rá  r¬  r�   rß  rÞ  rª   r«   r¬   s   @r%   r®  r®  à  s<   ø‡ € ô#ò6ò&òò8
ò$-ò9ò4ò÷ð r'   r®  c           	      óè   €  ^ RI Hp T'       d   \	        T4      pMRpTP                  TTTTTP                  TR7      pTP                  T 4      w  ršpT
#   \         d   p\        R4      ThRp?ii ; i)r   Nzoauth support is not available)Úclient_secretÚresource_owner_keyÚresource_owner_secretÚsignature_methodrÚ  )Úoauthlib.oauth1Úoauth1ÚImportErrorÚNotImplementedErrorr.   ÚClientÚSIGNATURE_PLAINTEXTÚsign)r#   r°  r²  r³  r±  rÚ  rô  r{   ÚclientÚ_uriÚsigned_headersÚ_bodys   &&&&&&      r%   rÛ  rÛ  _  s†   € ðKÝ(÷ Ü˜	“N‰	àˆ	à�]‰]ØØ%Ø$Ø*Ø×3Ñ3Øð ó €Fð #)§+¡+¨cÓ"2Ñ€D˜%ØÐøô# ô KÜ!Ð"BÓCÈÐJûðKús   ‚A ÁA1Á A,Á,A1)ra   r•   )rF  é
   )Ir  rC   ri   rÆ  ÚloggingrÂ  r>  rú   Úconcurrent.futuresr   r   r   Úemail.utilsr   Ú	functoolsr   Úhttp.clientr   Ú	itertoolsr	   Ússlr
   Útypingr   r   r   r   r   r   r   r   r   Úurllib.parser   r   r   r   rÄ   r   Ú	cloudinitr   r   r   Ú	getLoggerr¦   rN   r   rÓ   r  r&   r7   rS   r}   r‡   r‘   r“   r   rW   r‰   r…   r   rö   rÿ   r  r�   rE  r^  r`  rX   rm   r¬  r®  rÛ  r4   r'   r%   Ú<module>r
     sd  ðó Û Û 	Û Û Û 	Û Û ß MÑ MÝ !Ý Ý !Ý Ý &÷
÷ 
õ 
÷ ?Ó >ã Ý ç 0Ñ 0à×Ò˜Ó!€à€Ø˜X z l°DÐ&8Õ9Õ:Ð ò"òõ ÷.õDMõ &÷<-ñ -ô3�>ô 3ô
(�.ô (÷
.Kñ .Kôbˆwô òõ$!ðH ð '+÷ ðFm=ð 
ðm=ð ð	m=ð
 ðm=ð ðm=ð ðm=ð ðm=ð ðm=ð ðm=ð ðm=ð ðm=ð '+ðm=ð ðm=ð ðm=ð  ð!m=ð" ð#m=ð$ ÷%m=÷`÷$P-ôf�jô ð|ñ ˜E“lð|ð  $ð	|ð
 Ÿ)™)ð|ð &*ð|ð ð|ð #'ð|ð '+ð|ð >Bð|ð ð|ð #'ð|ð ÷|÷~|ñ |ö~r'   