File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/charmed_postgresql.cpython-39.pyc
a
\��h7 � @ 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.yamlZsnap_daemonzcharmed-postgresql.psqlzcharmed-postgresql.patronictlc @ sL e Zd ZdZdZdZeed�dd��Zeed�dd��Z d d
� Z
dd� Zd
S )�CharmedPostgreSQLzCharmed PostgreSQLZcharmed_postgresql)zcharmed-postgresql)�returnc C s
dt � �S )Nz--config-file )�PATRONI_CONFIG_FILE��self� r �I/usr/lib/python3.9/site-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 s: | � td � d�td � d�g� | �td � d�td � td � d�td � td � td
� td � td � g� | �d� | jd
dd� z�ttdd��}t�|�}W d � n1 s�0 Y |d | _ |d }|d �
d�}|\| _| _|d }|d }|d | _
|d | _W nL ttjttttf�yb } z$| �dt� d|� �� W Y d }~d S d }~0 0 | jt� d| j� d| j � �dtd� | jt� d| j� d | j � �d!td� | jt� d| j� d"| j � �d#td� | jtjd$<