| Server IP : 43.141.50.122 / Your IP : 113.219.202.173 Web Server : Apache System : Linux VM-8-5-opencloudos 6.6.34-9.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 19 19:35:45 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.1.27 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.11/site-packages/cloudinit/__pycache__/ |
Upload File : |
�
hg�d�4 � �� � d Z ddlZddlZddlZddlZddlmZ ej e� � Z ej
dddg� � Zd� Z G d� d e
� � Z dd
�Zdd�Zdd�Zd� Zdd�ZdS )z9Common utility functions for interacting with subprocess.� N)�ENOEXEC�
SubpResult�stdout�stderrc �~ � g }g }g }|D ]�}t |t � � r6|d �|dd� }n�|d | k r|� d| � � nft |t � � r.|� d| z � � s|� |� � n#|� t |� � � � ��|� |� � ��|r0t � d| | d� |� � � � |r7t d�
| d� |� � �� � � � �|S ) a� Ensure user-provided commands start with base_command; warn otherwise.
Each command is either a list or string. Perform the following:
- If the command is a list, pop the first element if it is None
- If the command is a list, insert base_command as the first element if
not present.
- When the command is a string not starting with 'base-command', warn.
Allow flexibility to provide non-base-command environment/config setup if
needed.
@commands: List of commands. Each command element is a list or string.
@return: List of 'fixed up' commands.
@raise: TypeError on invalid config item type.
r N� z%s z Non-%s commands in %s config:
%s�
zHInvalid {name} config. These commands are not a string or list:
{errors})�name�errors)�
isinstance�list�insert�str�
startswith�append�LOG�warning�join� TypeError�format)�base_command�commands�warningsr �fixed_commands�commands �3/usr/lib/python3.11/site-packages/cloudinit/subp.py�prepend_base_commandr sl � �"