NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/aap_containerized.cpython-36.pyc
3

~�g$�@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�RedHatPlugin�	PluginOptc@sXeZdZdZdZdZdZdZedde	d	d
�edde	dd
�gZ
d
d�Zdd�Zdd�Z
dS)�AAPContainerizedzPCollects details about AAP Containerized setup
    under a user's home directoryzAAP Containerized SetupZaap_containerized�sysmgmt�ansible�podman�username�z>Username that was used to setup AAP containerized installation)�defaultZval_typeZdesc�	directoryzhAbsolute path to AAP containers volume directory. Defaults to 'aap' under provided user's home directoryc
s�jd�}|s�jd�dS�jd�sFtjjd|���}�j|d��n
�jd���j��r���fdd�d'D�}�j|��j��n�jd��d��d|�d�dfd|�d�d fg}x|D]\}}�j	||d!�q�W�j
|�}x8|D]0}|�d"�}	�j	d|�d#|�d$�|	�d%d&��q�WdS)(Nr	z=Username is mandatory to collect AAP containerized setup logsr�~Zaapcsg|]}�j�|��qS�)�	path_join)�.0�path)�aap_directory_name�selfr�'/usr/lib/python3.6/aap_containerized.py�
<listcomp>;sz*AAPContainerized.setup.<locals>.<listcomp>�
containers�tls�controller/etc/*.cert�controller/etc/*.key�eda/etc/*.cert�
eda/etc/*.key�gateway/etc/*.cert�gateway/etc/*.key�hub/etc/*.cert�
hub/etc/*.key�hub/etc/keys/*.pem�postgresql/*.crt�postgresql/*.key�receptor/etc/*.crt�receptor/etc/*.key�receptor/etc/*.pem�redis/*.crt�redis/*.keyz
Directory z1 does not exist or invalid absolute path providedzsu - z -c 'podman info --debug'Zpodman_infoz  -c 'podman ps -a --format json'Zpodman_ps_all_json)�suggest_filenamez.logz -c 'podman logs �'Zaap_containers_log)r(Zsubdir)rrrrrrrrrrr r!r"r#r$r%r&r')Z
get_option�
_log_error�osr�
expanduserrZpath_existsZadd_forbidden_pathZ
add_copy_specZadd_cmd_output�_get_aap_container_names)
rr	Zuser_home_directoryZforbidden_pathsZpodman_commandsZcommand�filenameZaap_containersZ	containerZlog_filer)rrr�setup)sV









zAAPContainerized.setupcCs\y8d|�d�}|j|�}|ddkr6|dj�jd�SgStk
rV|jd�gSXdS)Nzsu - z& -c 'podman ps -a --format {{.Names}}'�statusr�output�
z"Error retrieving Podman containers)�exec_cmd�strip�split�	Exceptionr*)rr	�cmdZcmd_outrrrr-os

z)AAPContainerized._get_aap_container_namescCsHddddddg}|jd�}|dd	krDx|D]}||d
kr,dSq,WdS)
Nzdumb-init -- /usr/bin/envoyz!dumb-init -- /usr/bin/supervisordz'dumb-init -- /usr/bin/launch_awx_web.shz(dumb-init -- /usr/bin/launch_awx_task.shz+pulpcore-content --name pulp-content --bindzdumb-init -- aap-eda-managezps --noheaders -eo argsr0rr1TF)r3)rZ
aap_processesZ	ps_outputZprocessrrr�
check_enabled{s

zAAPContainerized.check_enabledN)rr)r)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesr�strZoption_listr/r-r8rrrrrs$
Fr)r+Zsos.report.pluginsrrrrrrrr�<module>s

NineSec Team - 2022