a >h @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)Z controllerTz%collect reports from controller nodes)ZcomputeFz"collect reports from compute nodescCs|jjtddS)NT)Z need_root)primaryZ file_exists INVENTORY)selfrD/usr/lib/python3.9/site-packages/sos/collector/clusters/openstack.py check_enabled0szrhosp.check_enabledc Csg}|drdnd}zt|jt}Wn>tyj}z&|d|td|WYd}~n d}~00zLdD]B}||rr||d D]}| ||d||qqrWn:ty}z"| d|d |WYd}~n d}~00|S) NrZ external_ipZctlplane_hostnamezError parsing yaml: z'Could not parse yaml for node addresses)Z ControllerZComputehostszError getting z host addresses: ) Z get_optionyamlZ safe_loadrZ read_filer ExceptionZlog_infolowerkeysappendZ log_error)rZ_nodesZ _addr_fieldZ_inverrZ_thostrrr get_nodes3s" ",zrhosp.get_nodesN)__name__ __module__ __qualname____doc__Z cluster_nameZ option_listr rrrrr rs r)r Zsos.collector.clustersrrrrrrr  s