a >h@s&ddlmZmZGdddeeZdS))Plugin RedHatPluginc@s4eZdZdZdZdZdZdZdZdZ dZ dd Z d S) EtcdaThe etcd plugin collects information from the etcd key-value store. It is primarily used by Kubernetes/OpenShift clusters and is often run inside a container within the cluster. Collections will default to executing within an `etcdctl` container, if one is present, and only execute on the host if such a container is not currently running. The `etcdctl` name preference is adopted from OpenShift Container Platform deployments. This plugin is written for etcd v3 and later. z etcd pluginetcd)r) containersystemservicesZcluster)/etc/etcd/etcd.conf)ZetcdctlrcCsd}|jD]}||r |}q"q |ddi|ddg|jd|dd|jd|d gd }|jd d |D|d dS) Nr Z etcd_confz /etc/etcd/caz/etc/etcd/*.keyz/var/lib/etcd/T)r recursivez /etc/etcd)r)versionz member listz alarm listzendpoint statuszendpoint healthcSsg|]}d|qS)zetcdctl ).0subr r ;/usr/lib/python3.9/site-packages/sos/report/plugins/etcd.py CzEtcd.setup..) containersZget_container_by_nameZ add_file_tagsZadd_forbidden_pathZadd_dir_listingZ add_copy_specZadd_cmd_output)selfZetcd_conZconZsubcmdsr r rsetup%s*   z Etcd.setupN) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZpackagesZprofilesfilesrrrr r r rrs rN)Zsos.report.pluginsrrrr r r r s