| Server IP : 3.7.136.76 / Your IP : 216.73.216.142 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-39-148 7.0.0-1010-aws #10~24.04.1-Ubuntu SMP PREEMPT Mon Jul 27 17:41:33 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/__pycache__/ |
Upload File : |
o
��ir1 �
@ s d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZmZ ddl
mZ e�e�Ze�ddd g�Zd
d� ZG dd
� d
e�Zdee
e e
e f fdd�Zdddddddddd� deeee
e e
e f defdd�Zd dd�Zd dee fdd�Zdd� Zd!dd�ZdS )"z9Common utility functions for interacting with subprocess.� N)�ENOEXEC)�
TextIOWrapper)�List�Optional�Union)�performance�
SubpResult�stdout�stderrc C s� g }g }g }|D ]A}t |t�r)|d du r|dd� }n(|d | kr(|�d| � nt |t�r<|�| � d��s;|�|� n|�t|�� q|�|� q|rWt�d| | d�|�� |ret dj
| 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 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�command� r �0/usr/lib/python3/dist-packages/cloudinit/subp.py�prepend_base_command s@
�
��
��r"