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/uaclient/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/__pycache__/util.cpython-314.pyc
+
��g�=�
��^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIH	t	^RI
HtHtH
t
HtHt^RIHtHt^RIHt^RIHt]!4tRRlt]P4!]!]44t!R	R
]P:4t!RR]P>4t R
t!R5RRllt"R.3RRllt#R6RRllt$RRlt%.R7Ot&]&3RRllt'RRlt(RRlt)RRlt*Rt+R t,R!R"R#R$R%R&R'R(R)R*/t-R+R,lt.R-R.lt/R/R0lt0R1R2lt1R3R4lt2R#)8�N��wraps)�Any�Dict�List�Optional�Union)�
exceptions�messages)�CONFIG_FIELD_ENVVAR_ALLOWLIST)�MessagingOperationsc�0�V^8�dQhR\R\/#)��name�return��str)�formats"�//usr/lib/python3/dist-packages/uaclient/util.py�__annotate__rs��������c�b�VR8XdR#VPR4pRV^&RPV4#)z1Replace the name of the root logger from __name__��.�	ubuntupro)�split�join)r�namess& r�replace_top_level_logger_namers0���r�z���J�J�s�O�E��E�!�H��8�8�E�?�rc�6aa�]tRt^toRtV3RltRtVtV;t#)�DatetimeAwareJSONEncoderzBA json.JSONEncoder subclass that writes out isoformat'd datetimes.c�<�\V\P4'dVP4#\SV`V4#�N)�
isinstance�datetime�	isoformat�super�default)�self�o�	__class__s&&�rr(� DatetimeAwareJSONEncoder.default"s1����a��*�*�+�+��;�;�=� ��w��q�!�!r�)	�__name__�
__module__�__qualname__�__firstlineno__�__doc__r(�__static_attributes__�__classdictcell__�
__classcell__�r+�
__classdict__s@@rr!r!s����L�"�"rr!c�Faa�]tRt^(toRtV3Rlt]R4tRtVt	V;t
#)�DatetimeAwareJSONDecodera
A JSONDecoder that parses some ISO datetime strings to datetime objects.

Important note: the "some" is because we seem to only be able extend
Python's json library in a way that lets us convert string values within
JSON objects (e.g. '{"lastModified": "2019-07-25T14:35:51"}'). Strings
outside of JSON objects (e.g. '"2019-07-25T14:35:51"') will not be passed
through our decoder.

(N.B. This will override any object_hook specified using arguments to it,
or used in load or loads calls that specify this as the cls.)
c�p<�RV9dVPR4\SV`!VRVP/VBR#)�object_hookN)�popr'�__init__r;)r)�args�kwargsr+s&*,�rr=�!DatetimeAwareJSONDecoder.__init__6s4����F�"��J�J�}�%�
���$�G�D�,<�,<�G��Grc��VP4F-wr\V\4'gK\V4pW0V&K/	V# \dTpLi;ir#)�itemsr$r�parse_rfc3339_date�
ValueError)r*�key�value�	new_values&   rr;�$DatetimeAwareJSONDecoder.object_hook;sY���'�'�)�J�C��%��%�%�&� 2��!�I�#�#��$����	"�&� %�I�&�s�A�
A�Ar-)r.r/r0r1r2r=�staticmethodr;r3r4r5r6s@@rr9r9(s)�����H�
����rr9c�aa�VV3RlpV#)a�Decorator to retry on exception for retry_sleeps.

@param retry_sleeps: List of sleep lengths to apply between
   retries. Specifying a list of [0.5, 1] tells subp to retry twice
   on failure; sleeping half a second before the first retry and 1 second
   before the second retry.
@param exception: The exception class to catch and retry for the provided
   retry_sleeps. Any other exception types will not be caught by the
   decorator.
c�6<a�\S4VVV3Rl4pV#)c�<�SP4pS!V/VB# SddpT'gTh\PR\T4\	T44\
P!TP^44Rp?KoRp?ii;i)Tz%s: Retrying %d more times.N)�copy�LOG�debugr�len�time�sleepr<)r>r?�sleeps�e�	exception�f�retry_sleepss*,  ���r�	decorator�)retry.<locals>.wrapper.<locals>.decoratorWsu���!�&�&�(�F��.��d�-�f�-�-�� �.�!����I�I�5�s�1�v�s�6�{���J�J�v�z�z�!�}�-�-��
.�s��B�AB�Br)rVrXrUrWsf ��r�wrapper�retry.<locals>.wrapperVs!���	�q��	.�
�	.��rr-)rUrWrZsff r�retryr\Js����"�Nrrc
��V^8�dQhR\\\3,R\\\3,R\R\\\3,/#)r�	orig_dict�new_dict�pathr)rrr)rs"rrrjsD�����C��H�~��)-�c�3�h���?B��	�#�s�(�^�rc���/pVP4F�wrEVPV\4pV'gTMVR,V,p\V\4'd5WA9d%\WQV,VR7pV'dW�V&KsKu\W4&KWV8wgK�\PRV\V44WcV&K�	VP4FwrEW@9gK
WSV&K	V#)z<Return a dictionary of delta between orig_dict and new_dict.r)r`z'Contract value for '%s' changed to '%s')	rB�get�DROPPED_KEYr$�dict�get_dict_deltasrNrOr)	r^r_r`�deltasrErFrG�key_path�	sub_deltas	&&&      rrerejs����F��o�o�'�
���L�L��k�2�	�"�3��s�
�S�(8���e�T�"�"���+��C�=�x��	��"+�3�K��*���
�
��I�I�9���I��
�
$�3�K�%(�&�n�n�&�
�����3�K�'��Mrc�R�V^8�dQhR\R\\,R\/#)r�msg�
valid_choicesr)rr)rs"rrr�s%�������c���C�rc
�F�^RIHpVP4pRpRPTRP	VUu.uFqUP4NK	up44pVP
V4\R4P4pWA9dV#VP
V4KGuupi)a3Interactive prompt message, returning a valid choice from msg.

Expects a structured msg which designates choices with square brackets []
around the characters which indicate a valid choice.

Uppercase and lowercase responses are allowed. Loop on invalid choices.

:return: Valid response character chosen.
)�event_loggerrz{} is not one of: {}z, z> )	�uaclientrm�get_event_loggerrr�upper�info�input�lower)rjrkrm�eventrF�choice�	error_msgs&&     r�prompt_choicesrw�s���&��)�)�+�E��E�&�-�-�
�t�y�y�}�E�}�V�,�,�.�}�E�F��I��
�
�
�3���d��!�!�#���!���L�	�
�
�9���Fs�Bc�H�V^8�dQhR\R\R\R\/#)rrj�
assume_yesr(r)r�bool)rs"rrr�s,����	��#��6:��	�rc��V'dR#V'g\Pp\V4P4P	4pVR8XdV#VR9dR#R#)a}
Display a confirmation prompt, returning a bool indicating the response

:param msg: String custom prompt text to emit from input call.
:param assume_yes: Boolean set True to skip confirmation input and return
    True.
:param default: Boolean to return when user doesn't enter any text

This function will only prompt a single time, and defaults to "no" (i.e. it
returns False).
TrF)�y�yes)r�
PROMPT_YES_NOrrrs�strip)rjryr(rFs&&& r�prompt_for_confirmationr��sM������$�$���#�J����$�$�&�E���{�������rc�^�V^8�dQhR\\\3,R\R\/#)r�config�
path_to_valuer)rrrrz)rs"rrr�s)��$
�$
��c�3�h��$
��$
��$
rc�X�Tp/pVPR4pVR,pVF5pWe8XdRp\V\4'dVPWc4pK4R#	\	V4pVP4R8XdR#VP4R8XdR#\P!VRVR7h)	a"Check if value parameter can be translated into a boolean 'True' value.

@param config: A config dict representing
               /etc/ubuntu-advantange/uaclient.conf
@param path_to_value: The path from where the value parameter was
                      extracted.
@return: A boolean value indicating if the value paramater corresponds
         to a 'True' boolean value.
@raises exceptions.UbuntuProError when the value provide by the
        path_to_value parameter can not be translated into either
        a 'False' or 'True' boolean value.
r�falseF�trueTzboolean string: true or false)r��expected_valuerF���)rr$rdrbrrsr
�InvalidBooleanConfigValue)r�r�rF�
default_value�paths�
leaf_valuerE�	value_strs&&      r�is_config_value_truer��s���
�E��M�����$�E��r��J�����#�M��e�T�"�"��I�I�c�1�E����E�
�I�����F�"��	���	�g�	%���2�2�'�:��
�	
rc�F�V^8�dQhR\\,R\/#)r�
redact_regexsr�rr)rs"rrrs �����S�	���rc�L�TpVFp\P!VRV4pK	V#)z4Redact known sensitive information from log content.z\g<1><REDACTED>)�re�sub)�logr��redacted_log�redact_regexs&&  r�redact_sensitive_logsr�s,���L�%���v�v�l�,>��M��&��rc�R�V^8�dQhR\\,R\R\/#)r�msg_opsryr)rr
rz)rs"rrrs*����
�)�
*��8<��	�rc��V'gR#VF?p\V\4'd\V4K&Vwr4WR&V!R/VB'dK>R#	R#)aPEmit messages to the console for user interaction

:param msg_op: A list of strings or tuples. Any string items are printed.
    Any tuples will contain a callable and a dict of args to pass to the
    callable. Callables are expected to return True on success and
    False upon failure.

:return: True upon success, False on failure.
TryFr-)r$r�print)r�ry�msg_op�functorr>s&&   r�handle_message_operationsr�sJ�������f�c�"�"��&�M�"�M�G�!+����?�T�?�?���rc�D�V^8�dQhR\R\P/#)r�dt_strr)rr%)rs"rrr&s ��4�4�s�4�x�'8�'8�4rc��\P!RRV4p\P!RRV4pVPRR4p\P!RRV4p\PP	VR	4#)
a8
Parse a datestring in rfc3339 format. Originally written for compatibility
with golang's time.MarshalJSON function. Also handles output of pythons
isoformat datetime method.

This drops subseconds.

:param dt_str: a date string in rfc3339 format

:return: datetime.datetime object of time represented by dt_str
z(\d{2}:\d{2}:\d{2})\.\d+z\g<1>z(\d{2}:\d{2}:\d{2})$z\g<1>Z�Zz+00:00z(-|\+)(\d{2}):(\d{2})$z\g<1>\g<2>\g<3>z%Y-%m-%dT%H:%M:%S%z)r�r��replacer%�strptime)r��dt_str_without_subseconds�
dt_str_with_z�dt_str_without_z�dt_str_with_pythonish_tzs&    rrCrC&s���(!#���#�X�v�!���F�F���,E��M�%�,�,�S�(�;�� "�v�v�!�#5�7G� �����%�%� �"7��rc�0�V^8�dQhR\R\/#)r�messagerr)rs"rrr]s����s��s�rc��\PPe.R\PPP49d�VP	RR4pVP	\
PR,R4pVP	\
PR,R4pVPRR4P4pV#)zq
Verify if the system can output unicode characters and if not,
remove those characters from the message string.
zUTF-8u—�-� r�ascii�ignore)
�sys�stdout�encodingrpr�r�
OKGREEN_CHECK�FAIL_X�encode�decode)r�s&r�handle_unicode_charactersr�]s���	�
�
���#��#�*�*�-�-�3�3�5�5�
�/�/�(�C�0��
�/�/�(�"8�"8�3�">��C���/�/�(�/�/�C�"7��<���.�.��(�3�:�:�<���Nrc���\PP4UUu/uF@wrVP4\9g!VPR4'g
VR8XgK>WbKB	upp#uuppi)�UA_FEATURES�UA_CONFIG_FILE)�os�environrBrsr�
startswith)�k�vs  r�get_pro_environmentr�wsc���J�J�$�$�&��&�D�A��7�7�9�5�5��<�<�
�&�&�� � �		
���&����s�6A,�A,�"A,c���RpVP4F�wr4VPV4p\V\4'd+\V\4'd\	W,V4KV\V\
4'd^\V\
4'dH\
V4'd0\V^,\4'dV!W,WCR7K�W@V&K�W@V&K�	R#)a�Merge the contents of overlay dict into base_dict not only on top-level
keys, but on all on the depths of the overlay_dict object. For example,
using these values as entries for the function:

base_dict = {"a": 1, "b": {"c": 2, "d": 3}}
overlay_dict = {"b": {"c": 10}}

Should update base_dict into:

{"a": 1, "b": {"c": 10, "d": 3}}

@param base_dict: The dict to be updated
@param overlay_dict: The dict with information to be added into base_dict
c�:�RRRRRR/p.pVPV4pVFhpRp\V4F9wr�V	PV4VPV48XgK,\W�4RpK;	V'dKWVPV4Kj	VP	V4R#)	�availableResourcesr�resourceEntitlements�type�	overrides�selectorFTN)rb�	enumerate�depth_first_merge_overlay_dict�append�extend)
�base_values�overlay_valuesrE�merge_id_key_map�values_to_append�id_key�
overlay_value�was_replaced�base_value_idx�
base_values
&&&       r�update_dict_list�8depth_first_merge_overlay_dict.<locals>.update_dict_list�s��� �&�"�F���
��
��!�%�%�c�*��+�M� �L�.7��.D�*���>�>�&�)�]�->�->�v�-F�F�2�:�M�#'�L�/E�
 �<� �'�'�
�6�,�	���+�,r)rEN)rBrbr$rdr��listrP)�	base_dict�overlay_dictr�rErFr�s&&    rr�r��s��� -�(#�(�(�*�
���]�]�3�'�
��j�$�'�'�J�u�d�,C�,C�*�9�>�5�A�
�
�D�
)�
)�j���.E�.E��:���:�j��m�T�#B�#B� ����@�E�"'�#��"�c�N�+r�x86_64�amd64�i686�i386�ppc64le�ppc64el�aarch64�arm64�armv7l�armhfc�0�V^8�dQhR\R\/#)r�archrr)rs"rrr�s��4�4��4��4rc�L�VP4p\PW4#r#)rs�ARCH_ALIASESrb)r��
arch_lowers& r�standardize_arch_namer��s������J����J�3�3rc�\�V^8�dQhR\\,R\\,/#)r�archesrr�)rs"rrr�s"��-�-�t�C�y�-�T�#�Y�-rc��\4pVFpVP\V44K	\\	V44#r#)�set�addr��sortedr�)r��deduplicated_archesr�s&  r�deduplicate_archesr��s9���%������� 5�d� ;�<���$�*�+�,�,rc�$�V^8�dQhR\/#)rr)rz)rs"rrr�s����t�rc�2�\P!4^8H#)r)r��getuidr-rr�we_are_currently_rootr��s��
�9�9�;�!��rc�<�V^8�dQhR\R\R\/#)r�filename�
new_extensionrr)rs"rrr�s!��&�&�S�&��&��&rc�d�\PPV4wr#VR,V,#)r)r�r`�splitext)r�r�r�
_extensions&&  r�set_filename_extensionr��s(���w�w�'�'��1��D��#�:�
�%�%rc�:�V^8�dQhR\\,/#)r�package_listr�)rs"rrr�s�����s�)�rc��RP\P!RPV4^PRRRRR74R,#)�
r�Fz  )�width�break_long_words�break_on_hyphens�initial_indent�subsequent_indent)r�textwrap�wrap)r�s&r�create_package_list_strr	�sF��	
�	�	��M�M�����&��!&�!&�#�"&�

�		
��
	�r)r)rFF)z(Bearer )[^\']+z(\'attach\', \')[^\']+z(\'machineToken\': \')[^\']+�(\'token\': \')[^\']+z((\'X-aws-ec2-metadata-token\': \')[^\']+z*(.*\[PUT\] response.*api/token,.*data: ).*z(https://bearer:)[^\@]+z1(/snap/bin/canonical-livepatch\s+enable\s+)[^\s]+z>(Contract\s+value\s+for\s+'resourceToken'\s+changed\s+to\s+).*z(\'resourceToken\': \')[^\']+z(\'contractToken\': \')[^\']+zF(https://contracts.canonical.com/v1/resources/livepatch\?token=)[^\s]+z(\"identityToken\": \")[^\"]+zT(response:\s+http://metadata/computeMetadata/v1/instance/service-accounts.*data: ).*r
z(\'userCode\': \')[^\']+z(\'magic_token=)[^\']+z(--registration-key=\")[^\"]+z(--registration-key=\')[^\']+z(--registration-key=)[^ ]+z(--registration-key \")[^\"]+z(--registration-key \')[^\']+z(--registration-key )[^\s]+z
(-p \")[^\"]+z
(-p \')[^\']+z(-p )[^\s]+)3r%�json�loggingr�r�r�rrQ�	functoolsr�typingrrrrr	rnr
r�uaclient.defaultsr�uaclient.typesr
�objectrcr�	getLoggerr.rN�JSONEncoderr!�JSONDecoderr9r\rerwr�r��REDACT_SENSITIVE_LOGSr�r�rCr�r�r�r�r�r�r�r�r	r-rr�<module>rs�����	�	�
����3�3�)�;�.��h������5�h�?�@��"�t�/�/�"��t�/�/��D�@�<!�R��4�4$
�N��@%:���44�n�4�1#�j
�g�
�F�
�y�
�w��g���4�
-��&�
r

Youez - 2016 - github.com/yon3zu
LinuXploit