a >hb @s(ddlZddlmZGdddeZdS)N)Clusterc@s4eZdZdZdZdgZddiZdZdgZdd Z d S) cepha! This cluster profile is for Ceph Storage clusters, and is primarily built around Red Hat Ceph Storage 5. Nodes are enumerated via `cephadm`; if your Ceph deployment uses cephadm but is not RHCS 5, this profile may work as intended, but it is not currently guaranteed to do so. If you are using such an environment and this profile does not work for you, please file a bug report detailing what is failing. By default, all nodes in the cluster will be returned for collection. This may not be desirable, so users are encouraged to use the `labels` option to specify a colon-delimited set of ceph node labels to restrict the list of nodes to. For example, using `-c ceph.labels=osd:mgr` will return only nodes labeled with *either* `osd` or `mgr`. zCeph Storage ClusterZ ceph_commonzlog-size2)Zcephadm)labelsz3Colon delimited list of labels to select nodes withcsg|_|jddd}|ddks:|d|d|jSt|dd}d d |d d D}|D]@|rtfd d|Ds| dqn|j dqn|jS)Nz0cephadm shell -- ceph orch host ls --format jsonT)Z need_rootstatusrz'Could not enumerate nodes via cephadm: outputcSsg|] }|r|qSr ).0Zlabr r ?/usr/lib/python3.9/site-packages/sos/collector/clusters/ceph.py :z"ceph.get_nodes..r:c3s|]}|dvVqdS)rNr )r Z_lZnoder r <rz!ceph.get_nodes..z! filtered from list due to labelshostname) nodesZexec_primary_cmdZ log_errorjsonloads splitlinesZ get_optionsplitanyZ log_debugappend)selfZceph_outrZ_labelsr rr get_nodes,s$  zceph.get_nodesN) __name__ __module__ __qualname____doc__Z cluster_nameZ sos_pluginsZ sos_optionsZpackagesZ option_listrr r r r rsr)rZsos.collector.clustersrrr r r r  s