3 ܓi @s.ddlZddlmZmZGdddeeZdS)N)Plugin UbuntuPluginc@s(eZdZdZdZdZdZd ZddZdS) MicroCloudzThe 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|jdddddg}|jdd|Dd}|jd |d d }|j|d d |j|d|d|dgdddddddddg}x@|D]8}tj|jd}|jd}|jd|d|d qWdS)Nzsnap.microcloud.*)Zunitsz cluster listZstatusz --versioncSsg|]}d|qS)z microcloud ).0Zsubcmdrr /usr/lib/python3.6/microcloud.py 'sz$MicroCloud.setup..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)querysuggested_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_membersr r zmicrocloud sql Zmicrocloud_sql_)Z add_journalZadd_cmd_outputZadd_dir_listingZ add_copy_specjsondumpsget)selfZmicrocloud_subcmdsZ dqlite_crtZdb_pathZqueriesZ query_entryr Z file_suffixrrr setups:    zMicroCloud.setupN)r)r) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesrrrrr rs r)r Zsos.report.pluginsrrrrrrr  s