%PDF- %PDF-
Mini Shell

Mini Shell

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

�

i��d���D�ddlmZmZddlmZddlmZGd�dee�Zy)�)�Plugin�RedHatPlugin)�quote)�matchc�,�eZdZdZdZdZd�Zdd�Zd�Zy)	�	Candlepinz Candlepin entitlement management�	candlepin)r	c�>�d|_d|_d}	t|�j�j	�D]�}|r|ddk(r�td|�rN|j
d�d|_|jj
d	�d
j
d�d|_td|�s�u|j
d�d|_��	|jd
ddd��d|ji|_
|jddgd��|jgd��|jd�|jd�}|j|d|j��|jd�}|j|d|j��y#ttf$rY��wxYw)N�	localhost��/etc/candlepin/candlepin.confr�#z&^\s*org.quartz.dataSource.myDS.URL=\S+�=��/��:z+^\s*org.quartz.dataSource.myDS.password=\S+�
candlepin_log�candlepin_error_log�candlepin_conf)z"/var/log/candlepin/candlepin.log.*z/var/log/candlepin/err.log.*r
�
PGPASSWORDz/var/log/candlepin/error.logz /var/log/candlepin/candlepin.log)�	sizelimit)r
�/etc/candlepin/broker.xmlz/var/log/candlepin/audit*.log*z%/var/log/candlepin/candlepin.log[.-]*z/var/log/candlepin/cpdb*.log*z/var/log/candlepin/cpinit*.log*z!/var/log/candlepin/error.log[.-]*z/var/log/tomcat*/catalina*log*z"/var/log/tomcat*/host-manager*log*z/var/log/tomcat*/localhost*log*z/var/log/tomcat*/manager*log*zdu -sh /var/lib/candlepin/*/*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 DESC�candlepin_db_tables_sizes)�suggest_filename�envzN            SELECT displayname, content_access_mode             FROM cp_owner;�simple_content_access)�dbhost�dbpasswd�open�read�
splitlinesr�split�IOError�
IndexError�
add_file_tagsr�
add_copy_spec�add_cmd_output�build_query_cmd)�self�cfg_file�line�_cmds    �>/usr/lib/python3/dist-packages/sos/report/plugins/candlepin.py�setupzCandlepin.setups���"�����
�2��	��X��+�+�-�8�8�:�

7���t�A�w�#�~���B�D�I�"&�*�*�S�/�!�"4�D�K�#'�+�+�"3�"3�C�"8��";�"A�"A�#�"F�q�"I�D�K��G��N�$(�J�J�s�O�A�$6�D�M�

7�	
���2A�,A�-=�
�	�!�$�-�-�0���	
���*�.�
��	�	�	
���
�	�"	
���;�<��#�#�
�
��	
���D�3N� $���	�	*��#�#�%���	
���D�-D� $���	�	*��}��$�	��	�s�BF
�.F
�
F�Fc�H�|rdnd}d}||j|t|�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
-A -F , -XrzUpsql --no-password -h %s -p 5432 -U candlepin                   -d candlepin %s -c %s)rr)r*�query�csv�	csvformat�_dbcmds     r.r)zCandlepin.build_query_cmdns.��%(�L�R�	�)������i��u��>�>�>�c��d}d}|jd||�d}|jd||�dD]}|jdd|zd	��y)
Nz$(((.*)(pass|token|secret)(.*))=)(.*)z
\1********r
z(--password=)([a-zA-Z0-9]*)z/var/log/candlepin/cpdb.log)�trustStorePassword�keyStorePasswordrz(%s)=(\w*)([;<])z
\1=********\3)�do_file_sub)r*�reg�repl�cpdbreg�keys     r.�postproczCandlepin.postproc{sb��5�������8�#�t�D�0�����6���F�=�	/�C����8�0�3�6�-�
/�	/r5N)F)	�__name__�
__module__�__qualname__�
short_desc�plugin_name�packagesr/r)r>�r5r.rrs"��3�J��K��H�U*�n?�	/r5rN)�sos.report.pluginsrr�pipesr�rerrrEr5r.�<module>rIs ��4���t/���t/r5

Zerion Mini Shell 1.0