haxorqt
Home
Console
Upload
information
Create File
Create Folder
About
:
/
opt
/
cloudlinux
/
venv
/
lib64
/
python3.11
/
site-packages
/
clselect
/
__pycache__
/
Filename :
utils.cpython-311.pyc
back
Copy
� �lj�G � � � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlmZ d dl mZmZmZmZ d dlmZ d dlmZmZ d d lmZ d d lmZ d dlmZmZmZ d dlm Z d d l!m"Z" d dl#m$Z$ ddl%m&Z& ddl'm(Z( dZ)dZ*d:d�Z+d;d�Z,d� Z-d� Z.d� Z/d� Z0d� Z1d� Z2d� Z3d<d�Z4d:d�Z5ej6 ej7 z ej8 z ej6 ej7 z ej8 z ej6 ej7 z ej9 z ej6 ej7 z ej9 z d �Z:d:d!�Z;d=d#�Z<d=d$�Z=d%� Z>d&� Z?d'� Z@d(� ZAd)� ZBd*� ZCd+� ZDd>d.�ZEd/� ZFd0� ZGd1� ZHd:d2�ZId3eJd4eKfd5�ZLd6eJfd7�ZMd8� ZNd9� ZOdS )?� )�print_function)�absolute_import)�divisionN)�time)�AnyStr�List�Dict�Optional)�Path)�urlparse� urlunparse)�resolve_username_and_doc_root)�CP_NAME)�NoDomain�NotSupported� IncorrectData)�mod_makedirs)�init_sentry_client)�get_pkg_version� )�clprint)�ClSelectExceptz/sbin/cagefs_enter_userzehttps://9713d1296f804031b058b8f2d789d7ac:8ddacae32d8246cf8b25cf826bf3fc0a@cl.sentry.cloudlinux.com/12c � � t j | t d� � t j t j d|d�� � }|� � � \ }}nA# t t f$ r-}t j | d t |� � � � �d}~ww xY w|j dk r/t j |pdd� | � � �d|��� � �|S ) z� Runs external process and returns output :param cmd: command and arguments as a list :param env_data :return string � /dev/nullT)�stdin�stdout�stderr� close_fds�env�textr Nzoutput of the command: � � )� subprocess�Popen�open�PIPE�STDOUT�communicate�OSError�IOErrorr �FileProcessError�str� returncode�ExternalProgramFailed�join)�cmd�env_data�output�std_out�std_err�es �E/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/utils.py�run_commandr7 ( s� � �>��!���{�#�#��?��$���� � � �� "�-�-�/�/�������W�� >� >� >��-�c�!�f�c�!�f�f�=�=�=�����>���� ��A����2��Q�Q�#�(�(�3�-�-�-�-���Q� � � � �Ns �AA �B�'(B�Bc �D � t j | t d� � t j t j |d||�� � }|� � � \ }}nA# t t f$ r-}t j | d t |� � � � �d}~ww xY w|j ||fS )a� Runs external process and returns output. Differs from subprocess.check_output, run_command above, and check_output below in that it does not throw an exception if process's return code != 0 :param cmd: command and arguments as a list :param env_data :param preexec_fn: Pre-exec function. None if don't need :param cwd: Directory name to set as current :return Cortege: (ret_code, stdout, stderr) r T)r r r � preexec_fnr �cwdr r N)r# r$ r% r&