Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/charmed_postgresql.cpython-312.pyc |
�
-�_g7 � � � d dl Z d dlZd dlmZmZ dZdZedz edz edz edz ed z ed
z edz edz d
�Zed � d�ZdZ dZ
dZ G d� dee� Zy)� 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 �P � e Zd ZdZdZdZedefd�� Zedefd�� Z d� Z
d� Zy )
�CharmedPostgreSQLzCharmed PostgreSQL�charmed_postgresql)zcharmed-postgresql�returnc � � dt � �S )Nz--config-file )�PATRONI_CONFIG_FILE��selfs �G/usr/lib/python3/dist-packages/sos/report/plugins/charmed_postgresql.py�patronictl_argsz!CharmedPostgreSQL.patronictl_args) s � �� 3�4�5�5� c �V � 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 s r � psql_argszCharmedPostgreSQL.psql_args- sA � ��d�.�.�/� 0��*�*�+� ,��*�*�+� ,,�,� -r c � � | j t d � d�t d � d�g� | j t d � d�t d � t d � d�t d � t d � t d
� t d � t d � g� | j d� | j d
d�� t t d�� 5 }t j |� }d d d � d | _ |d }|d j d� }|\ | _ | _ |d }|d }|d | _
|d | _ | j t, � d| j. � d| j � �dt0 �� | j t, � d| j. � d | j � �d!t0 �� | j t, � d| j. � d"| j � �d#t0 �� | j t2 j4 d$<