https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/charmed_postgresql.cpython-310.pyc
o

-�_g7�	@s�ddlZddlZddlmZmZdZdZededededed	ed
ededd
�Zed�d�ZdZ	dZ
dZGdd�dee�ZdS)�N)�Plugin�UbuntuPluginz#/var/snap/charmed-postgresql/commonz$/var/snap/charmed-postgresql/currentz/var/lib/postgresqlz/var/log/postgresqlz/etc/patroniz/var/log/patroniz/etc/pgbackrestz/var/log/pgbackrestz/etc/pgbouncerz/var/log/pgbouncer)�POSTGRESQL_CONF�POSTGRESQL_LOGS�PATRONI_CONF�PATRONI_LOGS�PGBACKREST_CONF�PGBACKREST_LOGS�PGBOUNCER_CONF�PGBOUNCER_LOGSrz
/patroni.yaml�snap_daemonzcharmed-postgresql.psqlzcharmed-postgresql.patronictlc@sLeZdZdZdZdZedefdd��Zedefdd��Z	d	d
�Z
dd�Zd
S)�CharmedPostgreSQLzCharmed PostgreSQL�charmed_postgresql)zcharmed-postgresql�returncCs
dt��S)Nz--config-file )�PATRONI_CONFIG_FILE��self�r�G/usr/lib/python3/dist-packages/sos/report/plugins/charmed_postgresql.py�patronictl_args)s
z!CharmedPostgreSQL.patronictl_argscCsd|j�d|j�d|j�d�S)Nz-U z -h z -p z -d postgres -P pager=off)�postgresql_username�postgresql_host�postgresql_portrrrr�	psql_args-s

��zCharmedPostgreSQL.psql_argsc
Cs8|�td�d�td�d�g�|�td�d�td�td�d�td�td	�td
�td�td�g�|�d�|jd
dd�zEttdd��
}t�|�}Wd�n1s]wY|d|_	|d}|d�
d�}|\|_|_|d}|d}|d|_
|d|_Wn%ttjttttfy�}z|�dt�d|���WYd}~dSd}~ww|jt�d|j�d|j	��dtd�|jt�d|j�d |j	��d!td�|jt�d|j�d"|j	��d#td�|jtjd$<|jt�d|j�d%�d&td�|jt�d|j�d'�d(td�|jt�d|j�d)�d*td�dS)+Nrz/*.pemr
rz/*.conf*rz/*.y*mlrrr	rzsnap.charmed-postgresql.*zsnap info charmed-postgresqlz	snap-info)�suggest_filenamezutf-8)�encoding�scope�
postgresql�connect_address�:�authentication�	superuser�username�passwordzVCan not run additional commands due to an error on opening or parsing the config file z: � z
 topology zpatroni-topology)r�runasz	 history zpatroni-historyz
 show-config zpatroni-dcs-config�
PGPASSWORDz	 -c '\l+'zpostgresql-databasesz -c '\duS+'zpostgresql-usersz -c '\dtS+'zpostgresql-tables)�add_forbidden_path�PATHS�
add_copy_spec�add_journal�add_cmd_output�openr�yaml�	safe_load�patroni_cluster_name�splitrrr�postgresql_password�OSError�	YAMLError�	TypeError�
ValueError�KeyError�AttributeError�	_log_warn�
PATRONICTLr�RUNAS�os�environ�PSQLr)r�f�patroni_configr�	host_portr r!�errorrrr�setup4s���

��


�����
��	��	���	�	
�zCharmedPostgreSQL.setupcCs^dtjvr	tjd=|�td�d�dd�|�td�d�dd	�|�td
�d�dd�dS)
Nr&rz/*z(password: )"?.*"?z
\1"*********"rz/pgbackrest.confz(.*s3-key.*=).*z\1*********r
z/pgbouncer/userlist.txtz(".*" )".*")r;r<�do_path_regex_subr(rrrr�postproc�s"
���zCharmedPostgreSQL.postprocN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�packages�property�strrrrBrDrrrrr
#snr
)
r;r-�sos.report.pluginsrr�SNAP_COMMON_PATH�SNAP_CURRENT_PATHr(rr:r=r9r
rrrr�<module>s&�

https://t.me/RX1948 - 2025