|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /lib/python3/dist-packages/certbot/__pycache__/ |
Upload File : |
U
�]\L � @ sD d Z ddlZddlZddlZddlmZ ddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ e
j �d
�r�ddlZdZndZe�e�Z e�!d
d�Z"e�!dd�Z#dZ$dZ%dZ&ej'�(d�Z)e�*� Z+e� Z,e j-fdd�Z.dd� Z/dd� Z0dd� Z1dd� Z2dUd d!�Z3dVd#d$�Z4d%d&� Z5dWd(d)�Z6dXd+d,�Z7d-d.� Z8d/d0� Z9d1d2� Z:d3d4� Z;d5d6� Z<d7d8� Z=dYd:d;�Z>d<d=� Z?dZd>d?�Z@e
�Ad@�ZBdAdB� ZCG dCdD� dDejD�ZEdEdF� ZFdGdH� ZGdIdJ� ZHdKdL� ZIdMdN� ZJdOdP� ZKdQdR� ZLdSdT� ZMdS )[zUtilities for all Certbot.� N)�OrderedDict)�Tuple�Union)� constants)�errors)�lock)�os)�
filesystem�linuxTF�Keyzfile pem�CSRzfile data formz[1mz[31mz[0m)z$The following error was encountered:z{0}zWEither run as root, or set --config-dir, --work-dir, and --logs-dir to writeable paths.c C s� zt j| t jt jdd�}W n8 ttfk
rR dd�| � }||� t�|��Y nX |�� \}}|j dkr�dd�| �||f }||� t�|��||fS )z�Run the script with the given params.
:param list params: List of parameters to pass to Popen
:param callable log: Logger method to use for errors
T)�stdout�stderr�universal_newlineszUnable to run the command: %s� r zError while running %s.
%s
%s)
�
subprocess�Popen�PIPE�OSError�
ValueError�joinr ZSubprocessError�communicate�
returncode)Zparams�log�proc�msgr
r � r �./usr/lib/python3/dist-packages/certbot/util.py�
run_scriptC s( �
�
r c C sT t j�| �\}}|rt�| �S t jd �t j�D ]}t�t j�|| ��r0 dS q0dS )z�Determine whether path/name refers to an executable.
:param str exe: Executable path or name
:returns: If exe is a valid executable
:rtype: bool
�PATHTF)r �path�splitr Z
is_executable�environ�pathsepr )Zexer �_r r r �
exe_existsa s
r% c C s&