403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/__pycache__/url_helper.cpython-314.pyc
+
��i��� � �^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIH	t	H
t
Ht^RIH
t
^RIHt^RIHt^RIHt^RIHt^RIHtHtHtHtHtHtHtHtHt^R	I H!t!H"t"H#t#H$t$^RI%t%^R
I%H&t&^RI'H(t(H)t)H*t*]PV!],4t-Rt.]]R
.]/3,,t0Rt1Rt2RRlt3RNRRllt4RRlt5RRlt6!RR4t7!RR]74t8!RR]74t9!RR4t:!R R
];4t<R!t=R"R#lt>R$R/R%R&llt?R'RR(RR)^R*^R+RR,RR-RR.RR/R0R1R0R$RR2RR3R4R5R0R6R7R8R4/R9R:llt@ROR;R<lltARPR>R?lltB!R@RA]4tCRB]D!RC4R(RRD]-P�R,RR-RRERR$RRFRR6R7RGR0RHR=/RIRJlltF!RKRL4tGRORMltHR#)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��\\VRR74pV^,'g!V^,'dV^,V^&RV^&\V4#)�http)�scheme�)�listrr)�url�
parsed_urls& �6/usr/lib/python3/dist-packages/cloudinit/url_helper.py�	_cleanurlr&1sG���h�s�6�2�3�J��a�=�=�Z��]�]�#�1�
�
�1�
��
�1�
��j�!�!�c�2�RpTpVFpV!W44pK
	V#)c���\\V44pV^,pV'd!VPR4'g
VR,
pV\\	V4RR7,
pW2^&\V4#)��/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_onsr2r#r/s&*   r%�combine_urlr7;s'��&��C����S�)����Jr'c�$�V^8�dQhR\/#�r*�return��int)�formats"r%�__annotate__r>Ks����s�r'c
�t�\PR\PR\PR\PR\
R/pVP
\V44pV'gN\V\4'd!VP'dVPpV#\PR4RpV#)z4helper for read_ftps to map return codes to a number�,���iXi�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_exceptionrSKs���	���C����3����3����C��#��O����t�C�y�)�D���c�7�#�#��	�	�	��9�9�D��K�	
�K�K�K�
��D��Kr'c�@�V^8�dQhR\R\R\RR/#)r*r#�timeout�kwargsr:�FtpResponse)r.�float�dict)r=s"r%r>r>bs.����3�������r'c
���\V4pVP'g\R\RVR7h\P
!4;_uu_4pVP;'g^pVP;'gRpRVP8XEdW\P!\4R7p\PRVV4TPVPTT;'gRR	7\PR
T4TP#TTP$;'gRR7\PR4TP'4\PRTP,4TP/RTP,2TP0R7\3TP54T4\PR4TP74uuRRR4#\P8!4p
\PRW4T
PVPTT;'gRR	7\PR
V4T
P#TVP$;'gRR7\PRVP,4V
P/RVP,2VP0R7\3VP54V4\PR4V
P74uuRRR4# \Pd(p\!T4p	\R
TRT	R2T	RTR7ThRp?ii;i \P(d+p\P+R4\RRRTR7ThRp?ii;i \Pd(p\!T4p	\RTRT	R2T	RTR7ThRp?ii;i \PR4TP74i;i \Pd(p\!T4p	\RTRT	R2T	RTR7ThRp?ii;i \PR4X
P74i;i +'giR#;i)aOconnect 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
zInvalid url providedN��causerR�headersr#�	anonymous�ftps)�contextz3Attempting to connect to %s via port [%s] over tls.�@)�host�portrUz1Reading file from server over tls failed for url z [�]z"Attempting to login with user [%s]r!)�user�passwdzCreating 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.rBzReading file: %szRETR )�callbackzClosing connectionz,Reading file from ftp server failed for url z(Attempting to connect to %s via port %s.)r�hostnamerr�io�BytesIOrc�usernamer rC�FTP_TLSr
rN�debug�connect�
all_errorsrS�login�password�prot_prFrOr1�
retrbinary�writerW�getvalue�close�FTP)r#rUrV�	url_parts�bufferrcre�ftp_tls�erR�ftps&&,        r%�	read_ftpsr}bs�� ��
�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�8Q�AL�$L�,Q�M�"-M�A#N�3%Q�$BO1�,A+O1�%Q�M�"L>�>M�Q�N�%N�N�Q�O�"N?�?O�O�'O.�.Q�1P-�"P(�(P-�-P0�0'Q�Q�Q+	c�(�V^8�dQhR\RR/#)r*r1r:�FileResponse�r.)r=s"r%r>r>�s��
M�
M�S�
M�~�
Mr'c�<�VPR4'd\PRV4\P!V4p\W 4# \dp\T\RTR7ThRp?i\dp\Y3PRTR7ThRp?ii;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[)rIrNrOr�load_binary_filer�FileNotFoundErrorrr�IOErrorrM)r1rV�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�Bc�2�V^8�dQhR\R,/#)r*r:)r�UrlResponserW)r)r=s"r%r>r>�s��&�&�
�7�8�&r'c��VP4p\V4pTPpTR8XgT'd%RT^,8Xd\TP3/TB#TR9d
\T3/TB#TR9d
\T3/TB#\PRT4\T3/TB# \dp\Y0R7ThRp?ii;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+zAttempting unknown protocol %s)r|r_)r�https)�lstripr�
ValueErrorrr r�r1r}�readurlrNrO)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<�<Cc�6a�]tRtRtoRRltRtRtRtVtR#)�StringResponseic�8�W0n/VnWnW nR#�N)rRr]r�r#)�selfr�r#rRs&&&&r%�__init__�StringResponse.__init__s���	���� �
��r'c� �VP^�8H#����rR�r��argsrVs&*,r%�ok�StringResponse.oks���y�y�C��r'c�8�VPPR4#)zutf-8)r��decode�r�s&r%�__str__�StringResponse.__str__s���}�}�#�#�G�,�,r')rRr�r]r#Nr�)	�__name__�
__module__�__qualname__�__firstlineno__r�r�r��__static_attributes__�__classdictcell__��
__classdict__s@r%r�r�s����� �-�-r'r�c�Baa�]tRtRtoRV3RlV3RllltRtVtV;t#)ri c�&<�V^8�dQhRS[RS[/#�r*r�r#��bytesr.)r=r�s"�r%r>�FileResponse.__annotate__!s���3�3��3�S�3r'c�*<�\SV`WVR7R#)r�N��superr�)r�r�r#rR�	__class__s&&&&�r%r��FileResponse.__init__!s���
����T��2r'r4r��r�r�r�r�r�r�r��
__classcell__�r�r�s@@r%rr s����3�3�3r'rc�>aa�]tRtRtoV3RlV3RlltRtVtV;t#)rWi%c�&<�V^8�dQhRS[RS[/#r�r�)r=r�s"�r%r>�FtpResponse.__annotate__&s���(�(��(�S�(r'c�&<�\SV`W4R#r�r�)r�r�r#r�s&&&�r%r��FtpResponse.__init__&s���
����'r'r4r�r�s@@r%rWrW%s����(�(�(r'rWc��a�]tRtRtoV3RlRlt]V3RlRl4t]V3RlRl4tRV3RlR	llt]R
4t	]V3RlRl4t
R
tRV3RlRlltRt
VtR#)r�i*c�4<�V^8�dQhRS[P/#)r*�response)�requests�Response)r=r�s"�r%r>�UrlResponse.__annotate__+s���"�"��!2�!2�"r'c��WnR#r���	_response)r�r�s&&r%r��UrlResponse.__init__+s��!�r'c� <�V^8�dQhRS[/#r9)r�)r=r�s"�r%r>r�/s���&�&�%�&r'c�b�VPPfR#VPP#)Nr')r��contentr�s&r%r��UrlResponse.contents.s%���>�>�!�!�)���~�~�%�%�%r'c� <�V^8�dQhRS[/#r9r�)r=r�s"�r%r>r�5s���"�"�S�"r'c�.�VPP#r�)r�r#r�s&r%r#�UrlResponse.url4s���~�~�!�!�!r'c� <�V^8�dQhRS[/#r9)�bool)r=r�s"�r%r>r�8s������r'c�\�RpV'dRp^�VPu;8:d
V8dR#R#R#)r@rATFr�)r��redirects_ok�uppers&& r%r��UrlResponse.ok8s-������E��$�)�)�#�e�#��$�r'c�.�VPP#r�)r�r]r�s&r%r]�UrlResponse.headersAs���~�~�%�%�%r'c� <�V^8�dQhRS[/#r9r;)r=r�s"�r%r>r�Fs���*�*�c�*r'c�.�VPP#r�)r��status_coder�s&r%rR�UrlResponse.codeEs���~�~�)�)�)r'c�.�VPP#r�)r��textr�s&r%r��UrlResponse.__str__Is���~�~�"�"�"r'c�L<�V^8�dQhRS[S[,RS[RS[S[,/#)r*�
chunk_size�decode_unicoder:)rr<r�r
r�)r=r�s"�r%r>r�Ls2���K�K�"�3�-�K�=A�K�	�%��Kr'c#�X"�VPPW4Rjx�L
R#L5i)aDIterates 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_contentLs����>�>�.�.�z�J�J�J�s�*�(�*r�N)F)�F)r�r�r�r�r��propertyr�r#r�r]rRr�r�r�r�r�s@r%r�r�*s�����"�"��&��&�
�"��"����&��&��*��*�#�K�K�Kr'r�c�6a�]tRtRtoRV3RlRlltRtVtR#)ri[Nc	�b<�V^8�dQhRS[RS[S[,RS[S[,RS[S[,/#)r*r\rRr]r#)rrr<rr.)r=r�s"�r%r>�UrlError.__annotate__\s@��������s�m���'�"�	�
�c�]�r'c��\PV\V44WnW nVf/MTVnW@nR#r�)r�r�r.r\rRr]r#)r�r\rRr]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%rr[s������r'c�$�/p\V4PpVR8XdrV'djRV9dVR,'dVR,VR&MRVR&RV9dRV9dVR,VR,.VR&V#RV9d\VR,4VR&V#)r��ca_certs�verifyT�	cert_file�key_file�cert)rr r.)r#�ssl_details�ssl_argsr s&&  r%�
_get_ssl_argsr�js����H�
�c�]�
!�
!�F�
���[���$��Z�)@�)@�!,�Z�!8�H�X��!%�H�X���+�%�*��*C��K�(��J�'� �H�V���O��K�
'�"�;�{�#;�<�H�V���Or'c�0�V^8�dQhR\R\/#)r*�retry_afterr:)r.rX)r=s"r%r>r>|s��!�!�#�!�%�!r'c��\V4pV# \d�p\T4pT'g
\R4Th\\P!T4\P!4,
4pM) \d\
P
RT4^pMi;iT^8d\
P
R4^pRp?T#Rp?ii;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)rXr�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�AA4�3C�4#B�C�B�!C�C�exception_cbc�R�V^8�dQhR\R\R\\,/#)r*�errorrr:)r�ExceptionCallbackrrX)r=s"r%r>r>�s,�� � �� �$� ��e�_�	 r'c�l�V'dV!V4'dR#VP'd�VPR8Xdo\PRVP4VP'd&\VPP
RR44#\PR4^#V'gR#Vh)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).zRetry-After�1z7Unable to introspect response header. Waiting 1 second.)rRrNrOr#r]r�rIr�)rrs&$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�dQhR\R\R\/#)r*rrr:)rr�r�)r=s"r%r>r>�s/��m=�m=�$�m=�$
�%m=�&�'m=r'c	��\V4pRVRV/pVP\W44V
VR&V'g
V'dRMRpVVR&Ve5\V\4'dVVR&M\\
V4^4VR&Vf.p^pV'd\\V4^,^4pR	\P!4,pVeVP4pM/pV'dVVR
&VfRpVf\P!4p\4EFcpV'd	V!V4pRV9dVVR&VVR&/pVP4F�wppVR
8XdKVR8XdqV'diVUu.uFpVPV4'gKVNK 	ppV'd5\P !V4VX&VFp\"VV,V&K	K�K�VVV&K�	V'd$\$P'R
TV
'dRMTVV4VP(!R/VBpV	'dVP+4\$P'RVVP,\/VP04V^,4\3V4u#	\IR4huupi \4P6dp\9TTR7ThRp?i\4P:dDp\9TTP<P,TP<P>TR7pTpRp?M6Rp?i\4P@dp\9TTR7pTpRpRp?MRp?ii;i\CTTR7pT'g"T
;'g
T^,T8pT'gTThT;'gTp T^8�gEKsT'd\$P'RT4\DPF!T 4EK�)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#rr�POST�GET�methodNrUz
Cloud-Init/%sr�z
User-Agentr]z'[%s/%s] open '%s' with %s configurationrz(Read from %s (%s, %sb) after %s attempts)r#�rRr]r#�r�1Please wait %s seconds while we wait to try againz"This path should be unreachable...���r4)%r&�updater�rK�tuple�maxrXr<r�version_string�copyr��Sessionr	�itemsrI�deepcopyrrNrm�request�raise_for_statusr��lenr�r�r�SSLErrorr�	HTTPErrorr�r]�RequestExceptionrr��sleep�RuntimeError)!r#r�rUrrr]r	r
r�rrrr
rrrr�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[�0J
�J
�J�&J�?#J�#AJ�L;�$J2�2L;�	L;�
9L�L;�L;� L6�6L;c��V^8�dQhR\R\3,R\R\R\P
R\\,R\/#)r*�func.�addrrU�event�delayr:)rrr.r<�	threading�EventrrX)r=s"r%r>r>ssU����
�3��8�
��

�����?�?�	�
�E�?��	�
r'c�V�V'dVPVR7'dR#V!W4#)z Execute func with optional delay�rUN��wait�r:r;rUr<r=s&&&&&r%�_run_func_with_delayrEss(��
�
�:�:�e�:�$�$�����r'�333333�?c
���V^8�dQhR\R\3,R\\,R\R\
R\\\,\\,3,/#)r*r:.�	addresses�
stagger_delayrUr:)	rrrr.rXr<rrr�)r=s"r%r>r>�sa��P-�P-�
�3��8�
�P-��C�y�P-��P-��	P-�
�8�C�=�(�;�/�/�0�P-r'c
��RpRpRp.p\P!4p\\V4R7p	\	V4U
Uu/uF'wr�V	P\VVVVW�,R7VbK)	pp
p\W�R7Fxp
W�,pV
P4pV'dTpVP!V4K9V
P4pV'gKSVP4WT3uV	PRR7#	V'd\PRVV4Vh\PRV4\!R	4huupp
i \"dG\PR
RP%T4RP%\'\(T444Mi;iT	PRR7YT3# T	PRR7i;i)aexecute 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_workersrDrAFrBz<Exception(s) %s during request to %s, raising last exceptionzEmpty result for address %szNo result returnedzJTimed out waiting for addresses: %s, exception(s) raised while waiting: %s� )r>r?rr%�	enumerate�submitrEr�	exception�append�result�set�shutdownrNrmrr�r�join�mapr.)r:rHrIrU�
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<�/AE�E�8	E�AE�AF�F,�F�F,�,Gc�,a�]tRtRtoV3RltRtVtR#)�HandledResponsei�c�n<�V^8�dQh/S[S[,;R&S[S[,;R&S[S[,;R&#)r*r#r��	wait_time)rr.r�rX)r=r�s"�r%r>�HandledResponse.__annotate__�s7����	�#�����{�#�#������
r'r4N)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�dQhR\R\\,R\R\\,R\\,R\R\\\\.\3,,R\
R	\R
\/
#)r*rerUrgr	r8rrhrrirj)rXrrrrr.r�)r=s"r%r>r>�s���|�|��|��e�_�	|�
�|���"�
|����|�$�|��H�c�5�\�5�%8�9�:�|��|� �|��|r'c�aaaaaa	aaaaaaa�RV3RllpRRRlloRRloRVV3RlloR	VVV	3R
lloRVVVVVVV3Rllp
R
VVVV3Rllp\P!4pS'dV'd\R4hV
'dT
MTpT;'gTp^oRpV!W�Ws4pRoVP'd#VPVPP
3#VP'd.\P!VP4S^,oRoKV!VS4pS!SVV4'dR#S^,o\PRV4\P!V4\P!4pV'gK�VV,VS,8�gEKSVV,
,
pV^8:gEK!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�dQhR\R\/#)r*�loop_numberr:)r<rX)r=s"r%r>�"wait_for_url.<locals>.__annotate__s��N�N�3�N�5�Nr'c�0<�SeS#V^,^,#r�r4)�_rnr8s&&�r%�default_sleep_time�(wait_for_url.<locals>.default_sleep_times���'�3�z�M���9I�A�9M�Mr'c�<�V^8�dQhR\R\R\/#)r*re�
start_timer8)rX)r=s"r%r>ros!��
�
��
�E�
�u�
r'c��V\R4R39dR#V^8*;'g'\P!4V,
V,V8�#)z4Check if time is up based on start time and max waitrfNF)rXr��	monotonic)rerur8s&&&r%�timeup�wait_for_url.<locals>.timeupsE����e��d�+�+���A�
�
�
��N�N��z�)�J�6��A�	
r'c��V^8�dQhR\\,R\\,R\\\,\3,/#)r*r�r#r:)rr�r.rr)r=s"r%r>ros<��'!�'!��;�'�'!�.6�s�m�'!�	�x��!�3�&�	'�'!r'c���RpRpV'd	V'gRp\\V44pW23#VPP4TP'gCRTP,p\\T4TPTPTR7pY23#TP4'g@RTP,p\\T4TPTPTR7pY23# \P
PdOp\TTPPTPPTR7pT\T43uRp?#Rp?ii;i)z?Map requests response code/contents to internal "UrlError" typer!NzRequest timed outrzempty response [%s]zbad status code [%s])rr�r�r$r�rr'r�r�r]r.r�rRr�)r�r#�reason�url_excr{s&&   r%�handle_url_response�)wait_for_url.<locals>.handle_url_responses7�������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�5E"�AE�E"�E"c�
�V^8�dQhR\\.\\\,\\
,3,3,R\\\\,3,R\R\R\R\/#)r*�
url_reader_cb�urlsru�exc_cb�log_cbr:)rrrrr.r�rrr<rr`)r=s"r%r>roDsu��*
�*
��
�E�5��#����(=�=�>�>�
�*
��C��c��N�#�	*
�
�*
�"�
*
��*
�
�*
r'c	�<�RpRpV!V4wrgS
!Wv4wr�V'g\WgRR7#\\P
!4V,
4p
S'd
RS,MRpRT;'g\
VR	R	4:R
V
:RV:RV:2pV!V4\RR\V\4'd\W�R
7R7#RR7# \dp	RT	,pT	pRp	?	L�Rp	?	i\dp	RT	,pT	pRp	?	L�Rp	?	ii;i)z:Execute request, handle response, optionally log exceptionr!N)rbzrequest error [%s]zunexpected error [%s]z%ss�	unlimitedz	Calling 'r#z
' failed [r+z]: r�r#r�rb)	r`r�	Exceptionr<r�rw�getattrrKr)r�r�rur�r�r|r#r�r}r{�
time_taken�max_wait_str�
status_msgr~res&&&&&        ��r%�read_url_handle_exceptions�0wait_for_url.<locals>.read_url_handle_exceptionsDs�������
	�)�$�/�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�5D�6D�Dc�<�V^8�dQhR\R\R\/#)r*r#rUr:)r.r<r�)r=s"r%r>rops!��
�
��
�s�
�{�
r'c	�><�\TSf/MS!V4SVRSR7#)NF)r]r
rUrr)r�)r#rUr	r
rs&&���r%�read_url_cb�!wait_for_url.<locals>.read_url_cbps-�����$�,�B�*�S�/�)���)�

�	
r'c�$�V^8�dQhR\/#r9�r`)r=s"r%r>rozs��"M�"M�	�"Mr'c�<a�RV
V3Rllp.pSF�p\P!4pS
^8wdbS'gZS!SV4'd\RRRR7u#Se7S'd/VS,VS,8�d\VS,V,
4oS!WFWV4pVP'dVu#VP
'gK�VP
VP
4K�	V'd\V4MRp	\RRV	R7#)zliterate over list of urls, request each one and handle responses
and thrown exceptions individually per url
c�$�V^8�dQhR\/#)r*r#r�)r=s"r%r>�;wait_for_url.<locals>.read_url_serial.<locals>.__annotate__�s��	4�	4�3�	4r'c�<�VS!VS43#r�r4)r#r�rUs&��r%�url_reader_serial�@wait_for_url.<locals>.read_url_serial.<locals>.url_reader_serial�s�����S�'�2�3�3r'Nr�)r�rwr`r<r�rbrPr)rurUr�r�r��
wait_timesr#�now�outrb�loop_nre�must_try_againr�r�rxr�s&f&&      �������r%�read_url_serial�%wait_for_url.<locals>.read_url_serialzs����	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�dQhR\/#r9r�)r=s"r%r>ro�s��
�
�	�
r'c�@<�\\SSVR7pS!VSWV4#)z�pass list of urls to dual_stack which sends requests in parallel
handle response and exceptions of the first endpoint to respond
)rIrU)rr^)	rurUr�r��url_reader_parallelrjr�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�rwr�r�r#r�rbr)rNrm)r�rerUrgr	r
r8rrhrrirjrrr�r�ru�do_read_url�calculate_sleep_timer��resp�current_sleep_time�current_timer~r�r�r�r�rxsfd$$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�]tRtRtoRRltRtRtRtRtRt	R	t
R
tRtRt
R
tVtR#)�OauthUrlHelperi�Nc�f�WnT;'gRVnW nW0nWPnRVn^VnVPVPVP3p\V4'g	RVnM\V4'g\R4hVP4pT;'g/VnR#)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	���VP'd�\PPVP4'dw\P
!RVP24;_uu_4\
VPRR7;_uu_4p\P!V4uuRRR4uuRRR4#R# +'giM;iRRR4R# +'giR#;i)zReading �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	��VP'gR#VP4pVf/pW#V&\P!RVP24;_uu_4\	VPRR7;_uu_4pVP\P!V44RRR4RRR4R# +'giL;i +'giR#;i)NzWriting �wr�)r�r�rr�r�rtr��dumps)r�rb�value�curr�s&&&  r%�update_skew_file�OauthUrlHelper.update_skew_files����"�"�"���!�!�#���;��C��D�	�
�
�
��$�*=�*=�)>�?�
@�
@�$����c�C
�C
�
��H�H�T�Z�Z��_�%�C
�
@�
@�C
�C
��
@�
@�
@�s$� C�:&B2	� C�2C
�=C�C	c��\V\4'd#VPR8XgVPR8XgR#RVP9d#\PRVP4R#VPR,p\P!\V44p\T\P!4,
4p\TP4PpTPPT^4p\!Yu,
4TP"8�d(TP%Ye4\PRYe4YPPT&R# \d"p\PRY$4Rp?R#Rp?ii;i)i�i�N�datez$Missing header 'date' in %s responsez#Failed to convert datetime '%s': %sz$Setting oauth clockskew for %s to %d)rKrrRr]rNrOr�r�rr�r<rr#�netlocr�rI�absr�r�)r�rOr��remote_timer{�skewrb�old_skews&&      r%r�OauthUrlHelper.exception_cbs���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?�?Fc	�z�VP'g/#Rp\V4PpVP'dGW0P9d7\	\
P
!44VPV,,p\
VVPVPVPVPVR7#)N)r#r�r�r�r��	timestamp)r�rr�r�r<r��
oauth_headersr�r�r�r�)r�r#r�rbs&&  r%r	�OauthUrlHelper.headers_cb-s����~�~�~��I��	���}�#�#���>�>�>�d�n�n�4��D�I�I�K�(�4�>�>�$�+?�?�I����*�*��n�n��*�*� �0�0��

�	
r'c��\VPVPR44VR&\VPVPR44VR&V!V/VB#)r	r)r�_headers_cbrI�
_exception_cb)r��wrapped_funcr�rVs&&&&r%�_wrapped�OauthUrlHelper._wrapped?s\��&����f�j�j��6� 
��|��")�����
�
�>� :�"
��~���T�,�V�,�,r'c�.�VP\W4#r�)r�r�r�s&*,r%r��OauthUrlHelper.wait_for_urlHs���}�}�\�4�8�8r'c�.�VP\W4#r�)r�r�r�s&*,r%r��OauthUrlHelper.readurlKs���}�}�W�d�3�3r'c�z�RpV'd	V!V4pVPV4V# TPT4i;i)Tr)r��extra_exception_cbrO�rets&&& r%r��OauthUrlHelper._exception_cbNs>����	)�!�(��3�����i�(��
��
���i�(�s�'�'�:c�j�/pV'd	V!V4pVPVPV44V#r�)rr	)r��extra_headers_cbr#r]s&&& r%r��OauthUrlHelper._headers_cbWs.�����&�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�rr	r�r�r�r�r�r�r�r�s@r%r�r��s<����#�6�&��8
�$-�9�4���r'r�c	���^RIHpT'd
\	T4pMRpTPTTTTTPTR7pTPT4wr�pT
# \dp\R4ThRp?ii;i)rNzoauth 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)rar�)rF�
)IrrCrir��loggingr�r>r��concurrent.futuresrrr�email.utilsr�	functoolsr�http.clientr�	itertoolsr	�sslr
�typingrrr
rrrrrr�urllib.parserrrrr�r�	cloudinitrrr�	getLoggerr�rNrr�rr&r7rSr}r�r�r�rrWr�r�rr�r�rr�rEr^r`rXrmr�r�r�r4r'r%�<module>r
sd���
�	���	���M�M�!��!��&�
�
�
�?�>���0�0�
����!�����X�z�l�D�&8�9�:��"�
� �.�D
M� &�<-�-�3�>�3�
(�.�(�
.K�.K�b�w���$!�H �'+� �Fm=�
�m=�
�	m=�

�m=��
m=�
�m=��m=��m=��m=��m=��m=�'+�m=�
�m=��m=� �!m=�"�#m=�$�%m=�`�$P-�f�j��|��E�l�|� $�	|�
�)�)�|�&*�
|��|�#'�|�'+�|�>B�|��|�#'�|��|�~|�|�~r'

Youez - 2016 - github.com/yon3zu
LinuXploit