Sindbad~EG File Manager

Current Path : /proc/2191876/root/usr/libexec/kcare/python/kcarectl/__pycache__/
Upload File :
Current File : //proc/2191876/root/usr/libexec/kcare/python/kcarectl/__pycache__/platform_utils.cpython-36.pyc

3

��"h�
�@s�ddlZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZd	Zd
d�Z
e	jdd
��Zdd�Zd#dd�Zdd�Ze	jdd��Ze	jdd��Ze	jdd��Zdd�Zdd�Zdd �Zd!d"�ZdS)$�N�)�	constants)�config)�	log_utils)�utils)�
process_utils)�selinuxz/usr/libexec/kcare/virt-whatcCs2tjdd�dkrtj�Sddl}|jdd�SdS)N���rF)�full_distribution_name)r
r)�sys�version_info�platform�linux_distribution�distro)r�r�4/usr/libexec/kcare/python/kcarectl/platform_utils.py�
get_distrosrcCstj�dS)Nr	)r�unamerrrr�get_system_unamesrcCsdtjdtjdfS)Nz%s.%srr)r
rrrrr�get_python_version$srFc	Cs�t�tjd�}tj�r^tjddddttj	��gdd�\}}}|sN|j
�d}nd	|}||d
<|rltj|�St
|�}d}x |D]}|d|||f7}q~W|j�S)
N)�python_version�
agent_version�psz-Zz--no-headersz--pidT)�catch_stdoutrz	error: %s�selinux_context�z%s: %s
)rr�VERSIONrZis_selinux_enabledr�run_command�str�os�getpid�split�json�dumps�sorted�rstrip)	�is_json�info�rc�stdout�stderrrZ	info_keysZinfo_strZinfo_keyrrr�app_info(s
&

r-cCsjd}tjj|�sdSxPtj|�D]B}|jd�r tjj||�}t|d��}|j�dd�dkSQRXq WdS)Nz/sys/firmware/efi/efivars/FZ
SecureBoot�rbr����)r!�path�exists�listdir�
startswith�join�open�read)Zefivars_location�filenameZvarfile�vfdrrr�is_secure_bootBs
r:cCsrtjrfy&tjtj�ddddtj�dd}Wqntjk
rb}ztj|�t	j
�}WYdd}~XqnXnt	j
�}|S)Nrr
)r�REPORT_FQDN�socket�getaddrinfo�gethostname�AI_CANONNAME�gaierrorr�logerrorr�node)�hostname�gerrr�get_hostnamePs&
rEcCsFtjjd�rBtdd�}|j�}ttt|j�d���}|j	�|SdS)Nz/proc/uptime�rrz-1)
r!r1�isfiler6�readliner �int�floatr#�close)�f�line�resultrrr�
get_uptime`s
rOcCs tjjt�rtjtg�j�SdS)Nzno-virt-what)r!r1rG�VIRTWHATr�check_output�striprrrr�get_virtlsrScCstjjd�S)Nz/usr/local/cpanel/cpanel)r!r1rGrrrr�	is_cpanelssrTcCstjjd�otjjd�S)Nz/proc/vz/veinfoz/proc/vz/version)r!r1r2rrrr�inside_vz_containerwsrUcCsdtd�j�kS)Nz/lxc/z/proc/1/cgroup)r6r7rrrr�inside_lxc_container{srVcCstjjd�S)Nz/.dockerenv)r!r1rGrrrr�inside_docker_containersrW)F)r$r!rr<r
rrrrrrrrPr�cachedrrr-r:rErOrSrTrUrVrWrrrr�<module>s.	


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists