CasperSecurity

Current Path : /lib/python3/dist-packages/DistUpgrade/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/DistUpgrade/__pycache__/telemetry.cpython-310.pyc

o

>I�c�
�@sBddlZddlZddlZddlZddlZdd�ZGdd�d�ZdS)�NcCstjdur	t�t_tjS)z'Return a singleton _Telemetry instance.N)�
_Telemetry�
_telemetry�rr�7/usr/lib/python3/dist-packages/DistUpgrade/telemetry.py�gets
rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rNcCs�i|_i|_|��|_tjgd�tjdd���d��|jd<|�	d�d|_
z td��}|��|jd	<Wd�WdS1s@wYWdSt
yQYdSw)
N)�lsb_releasez-rz-sT)�stdout�universal_newlinesr�From�startz/var/log/upgrade/telemetryz/var/log/installer/media-info�InstallMedia)�_metrics�_stages_hist�_get_current_uptime�_start_time�
subprocess�Popen�PIPE�communicate�strip�	add_stage�
_dest_path�open�readline�FileNotFoundError)�self�frrr�__init__)s(

���

&��z_Telemetry.__init__c
Cs�d}z#td��}t|����d�}Wd�W|S1swYW|StttfyD}zt�dt	|��WYd}~|Sd}~ww)z6Get current uptime info. None if we couldn't fetch it.Nz/proc/uptimerz)Exception while fetching current uptime: )
r�float�read�splitr�OSError�
ValueError�logging�warning�str)r�uptimer�errrr8s
������z_Telemetry._get_current_uptimecCs6|��}|jdus
|durdS||jt||j�<dS)z(Record installer stage with current timeN)rrr�int)r�
stage_name�nowrrrrCsz_Telemetry.add_stagecC�||jd<dS)zRecord updater type�TypeN�r
)r�updater_typerrr�set_updater_typeJ�z_Telemetry.set_updater_typecCr+)z*Record if the user had third party sources�ThirdPartySourcesNr-)r�usingrrr�set_using_third_party_sourcesNr0z(_Telemetry.set_using_third_party_sourcesc
Cs�|j|jd<tj�|j�}z<tj�|�st�|�t|jd��}t	�
|j|�Wd�n1s1wYt�|jtj
tjBtjBtjB�WdStye}zt�dt|��WYd}~dSd}~ww)z<Close telemetry collection

        Save to destination file�Stages�wNz(Exception while storing telemetry data: )rr
�os�path�dirnamer�exists�makedirsr�json�dump�chmod�stat�S_IRUSR�S_IWUSR�S_IRGRP�S_IROTHr!r#r$r%)r�
target_dirrr'rrr�doneRs*
�
��
����z_Telemetry.done)
�__name__�
__module__�__qualname__rrrrr/r3rDrrrrr%sr)r#r;r6r>rrrrrrr�<module>s
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY