PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /usr/libexec/kcare/python/kcarectl/__pycache__/
Server: Linux red.truehostdns.com 4.18.0-553.150.1.el8_10.x86_64 #1 SMP Fri Jul 31 15:23:31 EDT 2026 x86_64
IP: 51.161.15.103
Choose File :

Url:
Dir : //usr/libexec/kcare/python/kcarectl/__pycache__/update_utils.cpython-36.pyc

3

0�j�@s�ddlZddlZddlZddlZddlmZmZmZmZddl	m
Z
dZddd	�Zdd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�N�)�config�	constants�	log_utils�utils)�json_loads_nstr��<�.kcarestatuscCs$tjjtj|�}tj|tj��dS)N)�os�path�joinr�PATCH_CACHEr�atomic_write�
timestamp_str)�filename�status_filepath�r�2/usr/libexec/kcare/python/kcarectl/update_utils.py�touch_status_gap_filesrcCsztjjtj|�}tjj|�rvt|d��J}y.t|j��}t|�t	j
ttj�krTdSWnt
k
rjYnXWdQRXdS)N�rFT)rrr
rr�isfile�open�int�readr�STATUS_CHANGE_GAP�STATUS_CHANGE_GAP_DELAY�time�	Exception)rr�sfile�	timestamprrr�status_gap_passedsr!cCs|dkrtdj|���dS)N�kernel�libcarez$Unknown update status component: {0})r"r#)�
ValueError�format)�	componentrrr�_check_component%sr'cCsNtjtj�}|dkriSyt|�}|Sttfk
rHtjj	d�iSXdS)Nz"Failed to parse update status file)
r�	read_filer�UPDATE_STATUS_PATHrr$�	TypeErrorr�kcarelog�warning)�content�resultrrr�_load_update_status+sr/cCsft|�y4t�}|ttj��d�||<tjtjtj	|��Wn$t
k
r`tjj
ddd�YnXdS)N)�errorr zFailed to save update statusT)�exc_info)r'r/rrrrrr)�json�dumpsrrr+r,)r&r0�datarrr�save_update_status9sr5cCs>t|�}tt|dd��}|r:||kr:|j�r6dj|�S|S|S)N�status�zHTTP Error: {0})�str�getattr�isdigitr%)�err�messager6rrr�
_error_statusGs
r=cst���fdd�}|S)Ncstj����fdd��}|S)NcsTy�||�}Wn4tk
rB}zt�t|�d��WYdd}~XnXt�dd�|S)N)r0r7)rr5r=)�args�kwargsr.r;)r&�fnrr�inner_sz5track_update_status.<locals>.decorator.<locals>.inner)�	functools�wraps)r@rA)r&)r@r�	decorator^sz&track_update_status.<locals>.decorator)r')r&rDr)r&r�track_update_statusZsrEcCs^t|�y,t�}|j|i�jdd�}t|�dtj�Stk
rXtjj	ddd�dSXdS)Nr0r7zFailed to read update statusT)r1)
r'r/�getr8r�UPDATE_ERROR_MAX_LENGTHrrr+r,)r&r4r0rrr�read_update_errorosrHi,)r
)r
)rBr2rrr7rrrr�py23rrrr!r'r/r5r=rErHrrrr�<module>s