文件操作 - openstack.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/sos/collector/clusters/__pycache__/openstack.cpython-310.pyc
编辑文件内容
o i��d � @ s, d dl Z d dlmZ dZG dd� de�ZdS )� N)�Clusterz9/var/lib/mistral/overcloud/tripleo-ansible-inventory.yamlc @ s, e Zd ZdZdZg d�Zdd� Zdd� 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-ipFz0use IP addresses instead of hostnames to connect)� controllerTz%collect reports from controller nodes)�computeFz"collect reports from compute nodesc C s | j jtdd�S )NT)� need_root)�primary�file_exists� INVENTORY)�self� r �B/usr/lib/python3/dist-packages/sos/collector/clusters/openstack.py� check_enabled0 s zrhosp.check_enabledc C s� g }| � d�r dnd}zt�| j�t��}W n ty- } z| �d| � td��d }~ww z'dD ]!}| � |�� �rR|| d � � D ]}|� || d | | � qBq1W |S tyq } z| �d||f � W Y d }~|S d }~ww ) Nr �external_ip�ctlplane_hostnamezError parsing yaml: %sz'Could not parse yaml for node addresses)� Controller�Compute�hostsz#Error getting %s host addresses: %s)� get_option�yaml� safe_loadr � read_filer � Exception�log_info�lower�keys�append� log_error)r �_nodes�_addr_field�_inv�err�_t�hostr r r � get_nodes3 s0 ��������zrhosp.get_nodesN)�__name__� __module__�__qualname__�__doc__�cluster_name�option_listr r$ r r r r r s r )r �sos.collector.clustersr r r r r r r �<module> s
修改文件时间
将文件时间修改为当前时间的前一年
删除文件