o id @s,ddlZddlmZdZGdddeZdS)N)Clusterz9/var/lib/mistral/overcloud/tripleo-ansible-inventory.yamlc@s,eZdZdZdZgdZddZddZdS) rhospa This cluster profile is for use with Red Hat OpenStack Platform environments. Different types of nodes may be enumerated by toggling the various profile options such as Controllers and Compute nodes. By default, only Controller nodes are enumerated. Node enumeration is done by inspecting the ansible inventory file used for deployment of the environment. This is canonically located at /var/lib/mistral/overcloud/tripleo-ansible-inventory.yaml. Similarly, the presence of this file on the primary node is what triggers the automatic enablement of this profile. Special consideration should be taken for where `sos collect` is being run from, in that the hostnames of the enumerated nodes must be resolveable from that system - not just from the primary node from which those nodes are discovered. If this is not possible, consider enabling the `use-ip` cluster option to instead have this profile source the IP addresses of the nodes in question. zRed Hat OpenStack Platform))use-ipFz0use IP addresses instead of hostnames to connect) controllerTz%collect reports from controller nodes)computeFz"collect reports from compute nodescCs|jjtddS)NT) need_root)primary file_exists INVENTORY)selfr B/usr/lib/python3/dist-packages/sos/collector/clusters/openstack.py check_enabled0szrhosp.check_enabledc Csg}|dr dnd}z t|jt}Wnty-}z |d|tdd}~wwz'dD]!}||rR||d D]}| ||d||qBq1W|Styq}z| d||fWYd}~|Sd}~ww) Nr external_ipctlplane_hostnamezError parsing yaml: %sz'Could not parse yaml for node addresses) ControllerComputehostsz#Error getting %s host addresses: %s) get_optionyaml safe_loadr read_filer Exceptionlog_infolowerkeysappend log_error)r _nodes _addr_field_inverr_thostr r r get_nodes3s0zrhosp.get_nodesN)__name__ __module__ __qualname____doc__ cluster_name option_listrr$r r r r rs  r)rsos.collector.clustersrr rr r r r s