l#g"ZdZddlZddlZddlmZgdZGddejZdZdS)z0General utilities for working with subprocesses.N)PIPE)rCalledProcessError check_outputceZdZdZdZdS)rz'Add stdout,stderr to str representationc&|jrn|jdkrcd|jdtj|j d|jd|jS#t $r!d|j|j |j|jfzcYSwxYwd|j|j|j|jfzS)Nrz Command 'z ' died with z . Stdout: z Stderr: z?Command '%s' died with unknown signal %d. Stdout: %s Stderr: %szDCommand '%s' returned non-zero exit status %d. Stdout: %s Stderr: %s) returncodecmdsignalSignalsstdoutstderr ValueError)selfs U/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/subprocess.py__str__zCalledProcessError.__str__ s ? t22 HHHN(KKKKK    /x$/!14; LM +8T_dk4;GH s4A(A32A3N)__name__ __module__ __qualname____doc__rrrr s)11rrc tj|i|S#tj$r,}t|j|j|j|jdd}~wwxYw)z_A wrapper for stdlib subprocess.check_output. Include stdout/stderr in error message. N) subprocessrrrr r r )argskwargses rrr%se &7777  ( L!%18   sA'A  A)rr rr__all__rrrrrrs66  8 8 868     r