⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
cloudinit
/
__pycache__
/
View File Name :
subp.cpython-312.pyc
f1 R d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZmZm Z ej e Z ej" dddg Zd Z G d de Zde ee ee f fd Zdddddddddd de eeee ee f defdZddZddee fdZd ZddZy)z9Common utility functions for interacting with subprocess. N)ENOEXEC) TextIOWrapper)ListOptionalUnion SubpResultstdoutstderrc g }g }g }|D ] }t |t r&|d |dd }nl|d | k7 rd|j d| nQt |t r&|j | d s-|j | n|j t | |j | |r't j d| | dj | |r+t dj | dj | |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})nameerrors) isinstancelistinsertstr startswithappendLOGwarningjoin TypeErrorformat)base_commandcommandswarningsr fixed_commandscommands 0/usr/lib/python3/dist-packages/cloudinit/subp.pyprepend_base_commandr" s " H FNgt$qz!!!"+|+q,/ %%%a&89(MM#g,'g& /IIh BBH&!$))F*; CI C c X e Zd ZdZdZ d dZd Z d deee f deee f fdZ y)ProcessExecutionErrorzr%(description)s Command: %(cmd)s Exit code: %(exit_code)s Reason: %(reason)s Stdout: %(stdout)s Stderr: %(stderr)s-Nc 4 |xs | j | _ |r|| _ n|s|t k( rd| _ nd| _ t |t r|n| j | _ |s|| j n|| _ n| j | | _ |s|| j n|| _ n| j | | _ |xs | j | _ |r|| _ | j | j | j | j | j | j | j | j | j | j | j | j | j dz }t j | | y )Nz(Exec format error. Missing #! in script?z'Unexpected error while running command.)descriptioncmd exit_coder r reason) empty_attrr) r( r r intr* r _indent_textr r+ errnoMESSAGE_TMPL_ensure_stringIOError__init__) selfr r r* r) r( r+ r/ messages r! r3 zProcessExecutionError.__init__P sQ )$//*Du/IDHD $Is3I -3^$//DK++F3DK-3^$//DK++F3DK/DJ##..t/?/?@&&txx0,,T^^<))$++6))$++6))$++6 ' w'r# c F t |t r|j S |S )z1 if data is bytes object, decode r bytesdecode)r4 texts r! r1 z$ProcessExecutionError._ensure_string s !+4 7t{{}ATAr# r: returnc t |t s'|j d j ddd|z z S |j d j ddd|z z S )z indent text on all but the first line, allowing for easy to read output remove any newlines at end of text first to prevent unneeded blank line in output r r )r r8 rstripreplace)r4 r: indent_levels r! r. z"ProcessExecutionError._indent_text sZ $&;;t$,,T4#:L3LMM{{5!))%9L1LMMr# )NNNNNNN) )__name__ __module____qualname__r0 r, r3 r1 r r r8 r. r# r! r% r% E se J -(^B 56N#u*%N sEz Nr# r% argsc | D ]E }t |t rt |d r!t j d| t | d| y)zcheck argument types to ensure that subp() can run the argument Throw a user-friendly exception which explains the issue. args: list of arguments passed to subp() raises: ProcessExecutionError with information explaining the issue encodezRunning invalid command: %szRunning invalid command: )r) r+ N)r r8 hasattrr r r% )rG components r! raise_on_invalid_commandrL sJ 9e, 80LKK5t<'#