File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/charmed_postgresql.cpython-310.pyc
o
([Qh7 � @ s� d dl Z d dlZd dlmZmZ dZdZed ed ed ed ed ed
ed ed d
�Zed � d�ZdZ dZ
dZG dd� dee�ZdS )� 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_LOGSr z
/patroni.yaml�snap_daemonzcharmed-postgresql.psqlzcharmed-postgresql.patronictlc @ sL e Zd ZdZdZdZedefdd��Zedefdd��Z d d
� Z
dd� Zd
S )�CharmedPostgreSQLzCharmed PostgreSQL�charmed_postgresql)zcharmed-postgresql�returnc C s
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_argsc C s d| j � d| j� d| j� d�S )Nz-U z -h z -p z -d postgres -P pager=off)�postgresql_username�postgresql_host�postgresql_portr r r r � psql_args- s
��zCharmedPostgreSQL.psql_argsc
C s8 | � td � d�td � d�g� | �td � d�td � td � d�td � td � td
� td � td � g� | �d� | jd
dd� zEttdd��
}t�|�}W d � n1 s]w Y |d | _ |d }|d �
d�}|\| _| _|d }|d }|d | _
|d | _W n% ttjttttfy� } z| �dt� d|� �� W Y d }~d S d }~ww | jt� d| j� d| j � �dtd� | jt� d| j� d | j � �d!td� | jt� d| j� d"| j � �d#td� | jtjd$<