+
    ir$  c                   s:    ^ RI t ^ RIHtHtHt  ! R R]]4      tR# )i    N)PluginRedHatPlugin	PluginOptc                   s|   a  ] tR t^t o RtRtRtRtRt]	! RR]
RR7      ]	! RR]
R	R7      .tR
 tR tR tR tRtV tR# )AAPContainerizedzLCollects details about AAP Containerized setup
under a user's home directoryzAAP Containerized SetupZaap_containerizedusernameZ z>Username that was used to setup AAP containerized installation)ZdefaultZval_typeZdesc	directoryzhAbsolute path to AAP containers volume directory. Defaults to 'aap' under provided user's home directoryc                s   V P                  R 4      pV P                  R4      V n        V'       g   V P                  R4       V P                  R4      pVR,          ^ 8X  d   \	        4       pVR,          P                  4        F:  pRV9   g   K  RV9   g   K  VP                  ^R7      w  rVVP                  V4       K<  	  \        V4      ^8X  d'   VP                  4       pV P                  R	V R
24       MV P                  R4       R# V P                  '       g:   \        P                  P                  RV 24      pV P                  VR4      V n        V P                  V P                  4      '       dY   R+ Uu. uF  pV P                  V P                  V4      NK!  	  p	pV P!                  V	4       V P#                  V P                  4       MV P                  RV P                   R24       RV R2R3RV R2R3.p
V
 F  w  rV P%                  WR7       K  	  V P'                  V4      pV F<  pV P%                  RV RV R
2V R2RR7       V P%                  RV RV R
2VRR7       K>  	  RRR.R . R,OR!. R-OR"R#R$.R%R&R'./pVP)                  4        FG  w  ppVV9   g   K  V F2  pV P+                  V4      pV P%                  RV R(V R)V R*2VVR7       K4  	  KI  	  R# u upi ).r   r   zMAAP username is missing, use '-k aap_containerized.username=<user>' to set itzps auxstatusoutputz/usr/bin/podmanz!/.local/share/containers/storage/)ZmaxsplitzAAP username detected as 'Z'z5Unable to determine AAP username, terminating plugin.NZ~Zaapz
Directory z2 does not exist or invalid absolute path provided.su - z -c 'podman info --debug'Zpodman_infoz  -c 'podman ps -a --format json'Zpodman_ps_all_json)suggest_filenamez -c 'podman logs z.logZaap_container_logs)r	   Zsubdirz -c 'podman inspect Zpodman_inspect_logszautomation-controller-taskawx-manage check_license --dataawx-manage list_instanceszautomation-gatewayzautomation-controller-webzautomation-eda-apizaap-eda-manage --versionzaap-eda-manage showmigrationsZreceptorzreceptorctl statuszreceptorclt work listz -c 'podman exec -it  z
 bash -c "z"')Z
containersZtlszcontroller/etc/*.certzcontroller/etc/*.keyzeda/etc/*.certzeda/etc/*.keyzgateway/etc/*.certzgateway/etc/*.keyzhub/etc/*.certzhub/etc/*.keyzhub/etc/keys/*.pemzpostgresql/*.crtzpostgresql/*.keyzreceptor/etc/*.crtzreceptor/etc/*.keyzreceptor/etc/*.pemzredis/*.crtzredis/*.key)z!automation-gateway-service status!aap-gateway-manage print_settingsz!aap-gateway-manage authenticatorsz!aap-gateway-manage showmigrationsz aap-gateway-manage list_servicesz'aap-gateway-manage feature_flags --listzaap-gateway-manage --version)zawx-manage showmigrationsr   z"awx-manage run_dispatcher --statusz)awx-manage run_callback_receiver --statusr
   zawx-manage run_wsrelay --status)Z
get_optionaap_directory_nameZ	_log_warnexec_cmdZsetZ
splitlinessplitZaddZlenZpop
_log_errorospathZ
expanduserZ	path_joinZpath_existsZadd_forbidden_pathZadd_copy_specZadd_cmd_output_get_aap_container_namesZitemsZ_mangle_command)selfr   ZpsZpodman_usersZlineZuserZ_Zuser_home_directoryr   Zforbidden_pathsZpodman_commandsZcommandZfilenameZaap_containersZ	containerZpod_cmdsZpodZcmdscmdZfnames   &                   I/usr/lib/python3.14/site-packages/sos/report/plugins/aap_containerized.pysetupZAAPContainerized.setup)   sQ   ??:."&//+">NN J Kx(B(|q "uxL335D)T1;tC"&**a*"8$((.	 6
 |$)+//1HNN%?z#KLOO %: ; &&&"$''"4"4q
^"D&*nn5H5:'<D# D3344D t66=  . ##O4t667OOj)@)@(A BG G H
 XJ78-HXJ>?$&
 "1GC "1 66x@ (IH:%6ykC(1{$%7/   
 H:%9)AF%.0    (  )1++ ! # ( * !*/# $'5
> ")ICn$C 005E''%z :--0ESE)F9>/2 ( 4   *us   8%Kc                s     R V R2pV P                  V4      pVR,          ^ 8X  d'   VR,          P                  4       P                  R4      # . #   \         d    T P	                  R4       . u # i ; i)r   z& -c 'podman ps -a --format {{.Names}}'r   r   Z
z"Error retrieving Podman containers)r   Zstripr   Z	Exceptionr   )r   r   r   Zcmd_outs   &&  r   r   Z)AAPContainerized._get_aap_container_names   sv    	(#MNCmmC(Gx A%x(..066t<<I 	OO@AI	s   A
A A A0/A0c                s~    . ROpV P                  R4      pVR,          ^ 8X  d   V F  pW2R,          9   g   K   R# 	  R# )dumb-init -- /usr/bin/envoyzps --noheaders -eo argsr   r   TF)r   z!dumb-init -- /usr/bin/supervisordz'dumb-init -- /usr/bin/launch_awx_web.shz(dumb-init -- /usr/bin/launch_awx_task.shzdumb-init -- aap-eda-managez5pulpcore-content --name pulp-content --bind 127.0.0.1)r   )r   Zaap_processesZ	ps_outputZprocesss   &   r   check_enabledZAAPContainerized.check_enabled   sD     MM";<	X!#(11 )     c                s8   V P                    R 2pRpRpV P                  WV4       V P                    R2pRpRpV P                  WV4       V P                    R2pRpRpV P                  WV4       RpV P                  R	VR
4       RpV P                  R	VR4       R# )z/controller/etc/settings.pyz$(EMAIL_HOST_PASSWORD\s*=\s*)\'(.+)\'z
\1********z/gateway/etc/settings.pyz(\s*'PASSWORD'\s*:\s*)('.*')z/eda/etc/settings.yamlz6(\s*)(PASSWORD|MQ_USER_PASSWORD|SECRET_KEY)(:\s*)(.*$)z\1\2\3********z8((["\']?PASSWORD["\']?\s*[:=]\s*)[rb]?["\'])(.*?)(["\'])r   z\1**********\4z-((SECRET_KEY\s*=\s*)([rb]?["\']))(.*?)(["\'])z\1**********\5N)r   Zdo_path_regex_subZdo_cmd_output_sub)r   Z	file_pathZjregZreplZregexZreplacements   &     r   postprocZAAPContainerized.postproc   s    ..//JK	6y5 ..//GH	.y5 ..//EF	I'y= K/	 @/	r   )r   N)ZsysmgmtZansible)Zpodman)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z
short_descZplugin_nameZprofilesZpackagesr   ZstrZoption_listr   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      ss     % +J%K&HH 	-		
 	E		
K"@4F	$ r   r   )r   Zsos.report.pluginsr    r   r   r   ) r   r   <module>r      s     
 > >Zv| Zr   