Sindbad~EG File Manager
3
�f � @ s, d dl Z d dlmZ dZG dd� de�ZdS )� N)�Clusterz9/var/lib/mistral/overcloud/tripleo-ansible-inventory.yamlc @ s. e Zd ZdZdZdddgZdd� Zd
d� ZdS )�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-ipF�0use IP addresses instead of hostnames to connect�
controllerT�%collect reports from controller nodes�compute�"collect reports from compute nodesc C s | j jtdd�S )NT)Z need_root)�primaryZfile_exists� INVENTORY)�self� r
�/usr/lib/python3.6/openstack.py�
check_enabled0 s zrhosp.check_enabledc C s� g }| j d�rdnd}ytj| jjt��}W n8 tk
rd } z| jd| � td��W Y d d }~X nX yTxNd
D ]F}| j |j� �rnx2|| d j � D ]}|j
|| d | | � q�W qnW W n4 tk
r� } z| jd ||f � W Y d d }~X nX |S )Nzuse-ipZexternal_ipZctlplane_hostnamezError parsing yaml: %sz'Could not parse yaml for node addresses�
Controller�ComputeZhostsz#Error getting %s host addresses: %s)r r )Z
get_option�yamlZ safe_loadr
Z read_filer � ExceptionZlog_info�lower�keys�appendZ log_error)r Z_nodesZ_addr_fieldZ_inv�errZ_t�hostr
r
r � get_nodes3 s
&$zrhosp.get_nodesN)r Fr )r Tr )r Fr )�__name__�
__module__�__qualname__�__doc__Zcluster_nameZoption_listr r r
r
r
r r s r )r Zsos.collector.clustersr r r r
r
r
r �<module> s
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists