HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/pulpcore.cpython-36.pyc
3

\��h�#�@sBddlmZddlmZddlmZmZmZGdd�dee�ZdS)�)�match)�quote)�Plugin�IndependentPlugin�	PluginOptc@sveZdZdZdZdZdZedddd�gZd	Z	d
Z
dZdZdZ
d
ZdZde
iZdZdd�Zdd�Zddd�Zdd�ZdS)�PulpCorezPulp-3 aka pulpcoreZpulpcore�pulpcore-manager�/etc/pulp/settings.pyz	task-days�zdays of task history)�defaultZdescZ	localhosti8Zpulp�z/var/lib/pulp/assetsz/var/lib/pulp/media/upload�
PGPASSWORDcCs�d}ddd�}�yPt|jddd���4}�x*|j�jdd	�jd
d�jdd
�j�D�]}|sN|ddkrhqN|jd�rxd}qNd}|r�t|d|�r�||�|_|r�t|d|�r�||�|_|r�t|d|�r�||�|_	|r�t|d|�r�||�|_
|o�t|d|��r
||�|_|�rd|k�rd}|jd��r8||dd�|_|jd�rN||dd�|_
qNWWdQRXWntk
�rvYnXd|ji|_dS)z Parse pulp settings F�:cSsP|j|�dj�jd�}|jd�r,|jd�s@|jd�rL|jd�rL|dd�}|S)N��,�"�'���)�split�lstrip�rstrip�
startswith�endswith)�line�sep�val�r�/usr/lib/python3.6/pulpcore.py�separate_value)s
z6PulpCore.parse_settings_config.<locals>.separate_value�rzUTF-8)�encodingrz,
�{z{
�}z
}r�#Z	DATABASESTz\s*['|\"]%s['|\"]\s*:\s*\S+ZHOSTZPORT�NAMEZUSERZPASSWORDzSTATIC_ROOT = �=)rzCHUNKED_UPLOAD_DIR = Nr
)r)�open�
settings_file�read�replace�
splitlinesrr�dbhost�dbport�dbname�dbuser�dbpasswd�
staticroot�	uploaddir�IOError�env)�selfZdatabases_scoper�filer�patternrrr�parse_settings_config%s@
	






 zPulpCore.parse_settings_configcCs�d|_|_|jddd�}|ddkrP|dj�}t|�dkrPd|_d|_d	|_|j�|jd
dg|j|jd�|jd
�|j	dd|j|jd�dd
dd�}|j	d||j|jd�x(|j
|jgD]}|j||j|jd�q�W|j
d�}x�d&D]�}d|�d�}|j|j|�|j|j|jd�}|ddk�r0|dnd}	d|	�d|�d |�d!�}|j|�}
|j	|
|j||j|jd"�q�W|jd#�}
|j	|
d$|j|j|jd%�dS)'Nz"podman ps --filter name=rhui5-rhuaZrhui)�runasZstatusr�outputrz
rhui5-rhuaz%/var/lib/rhui/config/pulp/settings.pyz/etc/pulp/settings.pyz/etc/pki/pulp/*)r8�	containerz/etc/pki/pulp/**/*.keyz.curl -ks https://localhost/pulp/api/v3/status/Zpulp_status)�suggest_filenamer8r:zen_US.UTF-8zpulpcore.app.settings)�LC_ALLZ
PULP_SETTINGSZDJANGO_SETTINGS_MODULEz
dynaconf list)r3r8r:z	task-days�	core_task�core_taskgroup�core_groupprogressreport�core_progressreportz]COPY (SELECT STRING_AGG(column_name, ', ') FROM information_schema.columns WHERE table_name='zl'AND table_schema = 'public' AND column_name NOT IN ('args', 'kwargs', 'enc_args', 'enc_kwargs')) TO STDOUT;�*zselect z from z, where pulp_last_updated> NOW() - interval 'z! days' order by pulp_last_updated)r3r;r8r:a[SELECT table_name, pg_size_pretty(total_bytes) AS total, pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS toast, pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME, c.reltuples AS row_estimate, pg_total_relation_size(c.oid) AS total_bytes, pg_indexes_size(c.oid) AS index_bytes, pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r') a) a order by total_bytes DESCZpulpcore_db_tables_sizes)r;r3r8r:)r=r>r?r@)r8Zin_containerZexec_cmdr*�lenr'r7Z
add_copy_specZadd_forbidden_pathZadd_cmd_outputr0r1Zadd_dir_listingZ
get_option�build_query_cmdr3)r4Zrhui_podman_ps�linesZdynaconf_envZ_dirZ	task_days�tableZ_queryZcol_out�columnsZ_cmdrrr�setupZsV





zPulpCore.setupFcCs2|rd|�d�}d}||j|j|j|jt|�fS)aI
        Builds the command needed to invoke the pgsql query as the postgres
        user.
        The query requires significant quoting work to satisfy both the
        shell and postgres parsing requirements. Note that this will generate
        a large amount of quoting in sos logs referencing the command being run
        zCOPY (z6) TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)z0psql --no-password -h %s -p %s -U %s -d %s -c %s)r+r,r.r-r)r4ZqueryZcsvZ_dbcmdrrrrC�s

zPulpCore.build_query_cmdcCs(d}d}|jd||�|jd||�dS)Nz_((?:SECRET_KEY|AUTH_LDAP_BIND_PASSWORD)(?:\<.+\>)?(\s*=)?|(password|PASSWORD)(\"|'|:)+)\s*(\S*)z\1 ********z/etc/pulp/settings.pyz
dynaconf list)Zdo_path_regex_subZdo_cmd_output_sub)r4Zkey_pass_re�replrrr�postproc�szPulpCore.postprocN)r)r	)F)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZcommands�filesrZoption_listr+r,r-r.r/r0r1r3r'r7rGrCrIrrrrrs$5G
rN)	�rerZshlexrZsos.report.pluginsrrrrrrrr�<module>s