File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/corosync.cpython-38.pyc
U
i��db � @ sZ d dl mZmZmZmZ d dlZG dd� de�ZG dd� dee�ZG dd� deee�ZdS ) � )�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginNc @ s, e Zd ZdZdZdZdZdd� Zdd� Zd S )
�CorosynczCorosync cluster engine�corosync)Zcluster)r c
C s� | � dddg� | �dddddd d
g� | jddd
� | �d� d}| �|�sRd S d}zNt| �d�d��4}|D ](}t�||�rn| � t�||�� d�� qnW 5 Q R X W n4 t
k
r� } z| �d||f � W 5 d }~X Y nX d S )Nz
/etc/corosyncz/var/lib/corosync/fdataz/var/log/cluster/corosync.log*zcorosync-quorumtool -lzcorosync-quorumtool -szcorosync-cpgtoolzcorosync-cfgtool -szcorosync-blackboxzcorosync-objctl -azcorosync-cmapctl -m statszcorosync-cmapctlZcorosync_cmapctl)Ztagszkillall -USR2 corosyncz/etc/corosync/corosync.confz ^\s*(logging.)?logfile:\s*(\S+)$�r� zcould not read from %s: %s)Z
add_copy_specZadd_cmd_outputZexec_cmdZpath_exists�openZ path_join�re�match�search�group�IOErrorZ _log_warn)�selfZ
corosync_conf�pattern�f�line�e� r �=/usr/lib/python3/dist-packages/sos/report/plugins/corosync.py�setup s: �� �
(zCorosync.setupc C s | � ddd� d S )Nzcorosync-objctlz(.*fence.*\.passwd=)(.*)z\1******)Zdo_cmd_output_sub�r r r r �postproc: s
�zCorosync.postprocN) �__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesr r r r r r r
s %r c s e Zd Z� fdd�Z� ZS )�RedHatCorosyncc s t t| ��� d S �N)�superr r r �� __class__r r r D s zRedHatCorosync.setup)r r r r �
__classcell__r r r r r B s r c s e Zd Z� fdd�ZdZ� ZS )�DebianCorosyncc s t t| ��� d S r )r r# r r r r r r J s zDebianCorosync.setup)z/usr/sbin/corosync)r r r r �filesr"