Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/microovn.cpython-36.pyc
3

\��h��@s.ddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�UbuntuPluginc@s,eZdZdZdZdZd	Zd
ZdZdd�Z	dS)�MicroOVNz�The MicroOVN plugin collects the current status of the microovn
    snap.

    It will collect journald logs as well as output from various microovn
    commands.
    z
MicroOVN Snap�microovn�network�virtcCs�|jdd�ddddg}|jdd�|D��d	}|jd
|�d��d}|j|d
d�|j|�d�|�d�|�d�g�ddd�ddd�ddd�ddd�ddd�g}x@|D]8}tj|jd��}|jd�}|jd|��d |��d�q�WdS)!Nzsnap.microovn.*)Zunitszcluster listZstatuszcertificates listz	--versioncSsg|]}d|���qS)z	microovn �)�.0Zsubcmdrr�/usr/lib/python3.6/microovn.py�
<listcomp>(sz"MicroOVN.setup.<locals>.<listcomp>z+/var/snap/microovn/common/state/cluster.crtzopenssl x509 -in z -noout -datesz(/var/snap/microovn/common/state/databaseZls_microovn_dqlite_dir)Zsuggest_filenamez
/info.yamlz
/cluster.yamlz/../daemon.yamlz/SELECT * FROM sqlite_master WHERE type="table";Zschema)�query�suggested_file_suffixzgSELECT * FROM config WHERE NOT ( key LIKE "%keyring%" OR key LIKE "%ca_cert%" OR key LIKE "%ca_key%" );�configzSELECT * FROM services;Zservicesz5SELECT id, name, expiry_date FROM core_token_records;Z
token_recordszvSELECT id, name, address, schema_internal, schema_external, heartbeat, role, api_extensions FROM core_cluster_members;Zcore_cluster_membersrr
zmicroovn cluster sql Zmicroovn_cluster_sql_)Zadd_journalZadd_cmd_outputZadd_dir_listingZ
add_copy_spec�json�dumps�get)�selfZmicroovn_subcmdsZ
dqlite_crtZdb_pathZqueriesZquery_entryrZfile_suffixrrr
�setupsD


zMicroOVN.setupN)rr)r)r)
�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesZcommandsrrrrr
rsr)rZsos.report.pluginsrrrrrrr
�<module>s