HEX
Server: Apache
System: Linux cp11.instainternet.com 4.18.0-553.94.1.lve.el8.x86_64 #1 SMP Thu Jan 22 12:37:22 UTC 2026 x86_64
User: urbansports (1371)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/share/l.v.e-manager/__pycache__/exec_command.cpython-311.pyc
�

3@i��P�ddlmZddlmZddlmZddlZddlZd�Zdd�Zdd�ZdS)	�)�print_function)�division)�absolute_importNc��t|t��r.|���dkrgStj|��St|t
��r|SgS)z;
    Parses a command string into a list of arguments.
    �)�
isinstance�str�strip�shlex�split�list)�commands �l/builddir/build/BUILDROOT/lvemanager-7.11.31-1.el8.cloudlinux.x86_64/usr/share/l.v.e-manager/exec_command.py�
parse_commandrsZ���'�3�����=�=�?�?�b� � ��I��{�7�#�#�#�	�G�T�	"�	"�����	�c��g}	t|��}|std|�����tj|tj|d���}	|j���}|sn@|���dkr'|�|������\n4#t$r'}tdt|����Yd}~nd}~wwxYw|S)z
    Execute command
    �#The provided command is not valid: T��stdout�env�text�rzCall process error:N)r�
ValueError�
subprocess�Popen�PIPEr�readliner
�append�	Exception�printr	)rr�result�args�p�output�insts       r�exec_commandr&s����F�0��W�%�%���	N��L�7�L�L�M�M�M���T�*�/�s��N�N�N��	.��X�&�&�(�(�F��
���|�|�~�~��#�#��
�
�f�l�l�n�n�-�-�-�	.����0�0�0�
�#�S��Y�Y�/�/�/�/�/�/�/�/�����0�����Ms�B"B'�'
C�1C�Cc�V�	t|��}|std|�����tj|tj|d���}|���\}}|jdkrdSdS#t$r/}td|zdzt|��z��Yd}~nd}~wwxYwdS)	z*
    Execute command and check output
    rTrrFzCall process error(z): N)
rrrrr�communicate�
returncoderr r	)rrr"r#�res_in_json�errr%s       r�exec_command_checkr,1s���
C��W�%�%���	N��L�7�L�L�M�M�M���T�*�/�s��N�N�N���]�]�_�_���c�
�L�A����5��t���C�C�C�
�#�g�-��5��D�	�	�A�B�B�B�B�B�B�B�B�����C�����5s�A'A-�-
B&�7%B!�!B&)N)	�
__future__rrrrrrr&r,�rr�<module>r/s���&�%�%�%�%�%�������&�&�&�&�&�&����������������*�����r