Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/collector/clusters/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/collector/clusters/__pycache__/openstack.cpython-36.opt-1.pyc

3

�f�@s,ddlZddlmZdZGdd�de�ZdS)�N)�Clusterz9/var/lib/mistral/overcloud/tripleo-ansible-inventory.yamlc@s.eZdZdZdZdddgZdd�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 nodescCs|jjtdd�S)NT)Z	need_root)�primaryZfile_exists�	INVENTORY)�self�r
�/usr/lib/python3.6/openstack.py�
check_enabled0szrhosp.check_enabledcCs�g}|jd�rdnd}ytj|jjt��}Wn8tk
rd}z|jd|�td��WYdd}~XnXyTxNd
D]F}|j|j��rnx2||dj	�D]}|j
||d||�q�WqnWWn4tk
r�}z|jd	||f�WYdd}~XnX|S)Nzuse-ipZexternal_ipZctlplane_hostnamezError parsing yaml: %sz'Could not parse yaml for node addresses�
Controller�ComputeZhostsz#Error getting %s host addresses: %s)rr)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_nodes3s 
&$zrhosp.get_nodesN)rFr)rTr)rFr	)�__name__�
__module__�__qualname__�__doc__Zcluster_nameZoption_listrrr
r
r
rrsr)rZsos.collector.clustersrrrr
r
r
r�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists