Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/sunbeam.cpython-312.pyc |
�
-�_g� � �H � d dl Z d dlZd dlZd dlmZmZmZ G d� dee� Zy)� N)�Plugin�UbuntuPlugin� PluginOptc �b � e Zd ZdZdZdZdZdZ edde d� � ed
de
d� � gZd
� Zd� Z
d� Zy)�SunbeamzSunbeam Openstack Controller�sunbeam)�cloud)� openstackz/var/snap/openstack/common�sunbeam-user�ubuntuz&The user used for sunbeam installation)�default�val_type�desc�juju-allow-loginFzAllow sos to login to jujuc �& � | j d� | j | j � d�| j � d�| j � d�| j � d�| j � d�dg� | j g d�d �
� | j d� }|d d
k( r6t j |d � }|D ] }| j d|d � �� � | j d� } t j |� }|r�|j � d�}| j |� d�|� d�|� d�g� | j d� r| j d|� d�� | j d|�� }| j d|d�� }d } |d d
k( s|d d
k( rH |d j � d
}
|d j � d
}d!|
v sd!|v r| j |� d } | s| j d"� y y y # t $ r | j d|� d�� Y y w xY w# t $ r Y �Ew xY w)#Nzsnap.openstack.*z
/hooks.logz/state/daemon.yaml�#/state/truststore/sunbeam.maas.yamlz/state/database/info.yamlz/state/database/cluster.yamlz'/var/snap/openstack/current/config.yaml)zsunbeam cluster listz"sunbeam cluster list --format yamlzsunbeam manifest listT)�snap_cmdz#sunbeam manifest list --format yaml�statusr �outputzsunbeam manifest show --id �
manifestidr zUser "z�" does not exist, will not collect juju information. Use `-k sunbeam.sunbeam-user` option to define the user to use to collect data for sunbeamz/snap/openstack/commonz/*.logz/etc/*/*.logz/logs/*.logr zsu - z -c "sunbeam utils juju-login"zjuju whoami��runaszjuju status� )r �timeoutF�
Controllerz�juju is not logged in, will not collect juju information. Use `-k sunbeam.juju-allow-login=True` to login or use `juju login` as the sunbeam user to login)�add_service_status�
add_copy_spec�
common_dir�add_cmd_output�collect_cmd_output�yaml� safe_load�
get_option�pwd�getpwnam�KeyError� _log_warn�pw_dir�exec_cmd�
splitlines�_get_juju_cmd_details�
IndexError)�self�manifest_raw� manifests�manifest�sunbeam_user�user_pwd�sb_snap_homedir�juju_whoami�juju_status� logged_in�j_whoami�j_statuss �</usr/lib/python3/dist-packages/sos/report/plugins/sunbeam.py�setupz
Sunbeam.setup"