관리-도구
편집 파일: utils.cpython-311.pyc
� %�4g�? � �� � 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 dlmZ d d lmZ d d lmZmZmZ d dlmZ d dlmZ d d l m!Z! ddl"m#Z# ddl$m%Z% dZ&dZ'd7d�Z(d8d�Z)d� Z*d� Z+d� Z,d� Z-d� Z.d� Z/d� Z0d� Z1d9d�Z2d7d�Z3d:d!�Z4d:d"�Z5d#� Z6d$� Z7d%� Z8d&� Z9d'� Z:d(� Z;d)� Z<d;d,�Z=d-� Z>d.� Z?d/� Z@d7d0�ZAd1eBd2eCfd3�ZDd4eBfd5�ZEd6� ZFdS )<� )�print_function)�absolute_import)�divisionN)�time)�AnyStr�List�Dict�Optional)�Path)�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_commandr5 &