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

\��h�
�@s.ddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�UbuntuPluginc@s(eZdZdZdZdZdZd	Zdd�ZdS)
�
MicroCloudz�The MicroCloud plugin collects the current status of the microcloud
    snap.

    It will collect journald logs as well as output from various microcloud
    commands.
    zMicroCloud Snap�
microcloud�	containercCs�|jdd�dddg}|jdd�|D��d}|jd	|�d
��d}|j|dd
�|j|�d�|�d�|�d�g�ddd�ddd�ddd�g}x@|D]8}tj|jd��}|jd�}|jd|��d|��d
�q�WdS)Nzsnap.microcloud.*)Zunitszcluster listZstatusz	--versioncSsg|]}d|���qS)zmicrocloud �)�.0Zsubcmdrr� /usr/lib/python3.6/microcloud.py�
<listcomp>'sz$MicroCloud.setup.<locals>.<listcomp>z-/var/snap/microcloud/common/state/cluster.crtzopenssl x509 -in z -noout -datesz*/var/snap/microcloud/common/state/databaseZls_microcloud_dqlite_dir)Zsuggest_filenamez
/cluster.yamlz
/info.yamlz/../daemon.yamlz/SELECT * FROM sqlite_master WHERE type="table";Zschema)�query�suggested_file_suffixz5SELECT 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_membersrrzmicrocloud sql Zmicrocloud_sql_)Zadd_journalZadd_cmd_outputZadd_dir_listingZ
add_copy_spec�json�dumps�get)�selfZmicrocloud_subcmdsZ
dqlite_crtZdb_pathZqueriesZquery_entryrZfile_suffixrrr	�setups:


zMicroCloud.setupN)r)r)	�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesrrrrr	rsr)r
Zsos.report.pluginsrrrrrrr	�<module>s