%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/pulpcore.cpython-312.pyc

�

i��d>��H�ddlmZmZmZddlmZddlmZGd�dee�Zy)�)�Plugin�IndependentPlugin�	PluginOpt)�quote)�matchc�N�eZdZdZdZdZdZeddd��gZd	�Z	d
�Z
dd�Zd�Zy
)�PulpCorezPulp-3 aka pulpcore�pulpcore)zpulpcore-manager)�/etc/pulp/settings.py�	task-days�zdays of task history)�default�descc�(�d}d|_d|_d|_d|_d|_d|_dd�}	t
d	�j�jd
d�jdd
�jdd�j�D]�}|r|ddk(r�|jd�rd}�"d}|rt|dz|�r
||�|_|rt|dz|�r
||�|_|rt|dz|�r
||�|_|rt|dz|�r
||�|_|rd|vrd}|jd�r||d��|_|jd�s��||d��|_��	d|ji|_
y#t$rY�wxYw)NF�	localhosti8r
�z/var/lib/pulp/assetsz/var/lib/pulp/media/uploadc��|j|�dj�jd�}|jd�r|j	d�s"|jd�r|j	d�r|dd}|S)N��,�"�'���)�split�lstrip�rstrip�
startswith�endswith)�line�sep�vals   �=/usr/lib/python3/dist-packages/sos/report/plugins/pulpcore.py�separate_valuez6PulpCore.parse_settings_config.<locals>.separate_value&sh���*�*�S�/�!�$�+�+�-�4�4�S�9�C����s�#����S�(9����t�$����d�);��!�B�i���J�rrz,
�{z{
�}z
}r�#�	DATABASESTz\s*['|\"]%s['|\"]\s*:\s*\S+�HOST�PORT�NAME�PASSWORDzSTATIC_ROOT = �=)rzCHUNKED_UPLOAD_DIR = �
PGPASSWORD)�:)�dbhost�dbport�dbname�dbpasswd�
staticroot�	uploaddir�open�read�replace�
splitlinesrr�IOError�env)�self�databases_scoper"r�patterns     r!�parse_settings_configzPulpCore.parse_settings_configs�����!������ �����
�1���5���	�	��4�5�:�:�<��W�S�%�(����e�)<��W�S�%�(����
C���t�A�w�#�~���?�?�;�/�&*�O��9��"�u�W�v�-=�t�'D�"0��"6�D�K�"�u�W�v�-=�t�'D�"0��"6�D�K�"�u�W�v�-=�t�'D�"0��"6�D�K�"�u�W�z�-A�4�'H�$2�4�$8�D�M�"�s�d�{�&+�O��?�?�#3�4�&4�T�s�&C�D�O��?�?�#:�;�%3�D�c�%B�D�N�5
C�B!�$�-�-�0����
�	��	�s�D,F�F�	F�Fc�$�|j�|jddg�|jd�|jdd��dddd	�}|jd
|��|j|j
fD]}|jd|z��|j
d
�}dD]:}d|�d|�d�}|j|�}|j||j|���<|jd�}|j|d|j��y)Nrz/etc/pki/pulp/*z/etc/pki/pulp/**/*.keyz.curl -ks https://localhost/pulp/api/v3/status/�pulp_status)�suggest_filenamezen_US.UTF-8zpulpcore.app.settings)�LC_ALL�
PULP_SETTINGS�DJANGO_SETTINGS_MODULE�
dynaconf list)r:zls -l %sr)�	core_task�core_taskgroup�core_groupprogressreport�core_progressreportzselect * from z- where pulp_last_updated > NOW() - interval 'z! days' order by pulp_last_updated)r:rAa[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 DESC�pulpcore_db_tables_sizes)rAr:)	r>�
add_copy_spec�add_forbidden_path�add_cmd_outputr3r4�
get_option�build_query_cmdr:)r;�dynaconf_env�_dir�	task_days�table�_query�_cmds       r!�setupzPulpCore.setupTs;���"�"�$����#��
�	�
	
��� 8�9����L�-:�	�	<�"/�)@�2I�K��	
���O���>��_�_�d�n�n�5�	3�D����
�T� 1�2�	3��O�O�K�0�	�I�	L�E��Y�(�F��'�'��/�D�����$�(�(�U��K�
	L��#�#�
�
��	
���D�3M� $���	�	*r#c�t�|rd|z}d}||j|j|jt|�fzS)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
        z>COPY (%s) TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)z2psql --no-password -h %s -p %s -U pulp -d %s -c %s)r/r0r1r)r;�query�csv�_dbcmds    r!rOzPulpCore.build_query_cmd�sA���A�CH�I�E�E������d�k�k�4�;�;��e��M�M�Mr#c��|jddd�|jddd�|jddd�|jddd�y)	Nrz(SECRET_KEY\s*=\s*)(.*)z
\1********z(PASSWORD\S*\s*:\s*)(.*?)(,|\})z\1********\3rEz(SECRET_KEY<str>\s*)'(.*)'z(PASSWORD\S*\s*:\s*)(.*))�do_path_regex_sub�do_cmd_output_sub)r;s r!�postproczPulpCore.postproc�sf��	
���#�&��	�	
���#�.��	�	
����)��	�	
����'��	r#N)F)
�__name__�
__module__�__qualname__�
short_desc�plugin_name�commands�filesr�option_listr>rVrOr^�r#r!r	r	sA��&�J��K�$�H�&�E��+�q�/E�F��K�71�r-*�^N�r#r	N)	�sos.report.pluginsrrr�pipesr�rerr	rgr#r!�<module>rks%��D�C���X�v�(�Xr#

Zerion Mini Shell 1.0