Your IP : 216.73.217.13


Current Path : /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/maas.cpython-38.pyc

U

���b�@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�UbuntuPlugin�	PluginOptcs�eZdZdZdZdZdZdZedde	dd	�ed
de	dd	�edde	d
d	�gZ
dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Z�ZS)�MaaszUbuntu Metal-As-A-Service�maas)Zsysmgmt)rzmaas-common)z
maas-dhcpdzmaas-dhcpd6z	maas-httpz
maas-proxyz
maas-rackdzmaas-regiondzmaas-syslogzsnap.maas.supervisor�profile-name�zName of the remote API)�defaultZval_typeZdesc�urlzURL of the remote API�credentialszCredentials, or the API keycCs|�d�o|�d�o|�d�S)Nr
rr)�
get_option��self�r�9/usr/lib/python3/dist-packages/sos/report/plugins/maas.py�_has_login_options,s�zMaas._has_login_optionscCs2|�d|�d�|�d�|�d�f�}|ddkS)Nzmaas login %s %s %srr
r�statusr)�exec_cmdr)rZretrrr�_remote_api_login0s��zMaas._remote_api_logincCs|�d�ddkS)Nzsnap list maasrr)rr
rrr�_is_snap_installed;szMaas._is_snap_installedcst���rdS|��S)NT)�super�
check_enabledrr
��	__class__rrr>s
zMaas.check_enabledcCs�|��|_|jrF|�ddg�|�d�|�dddddd	d
ddg	�n$|�d
dddddg�|�ddg�|�d�r�|�dg�|��r�|��r�|�d|�d��n
|�	d�dS)Nzsnap info maaszmaas statusz'/var/snap/maas/current/bind/session.keyz/var/snap/maas/common/logz/var/snap/maas/common/snap_modez/var/snap/maas/current/*.confz/var/snap/maas/current/bindz/var/snap/maas/current/httpz"/var/snap/maas/current/supervisordz/var/snap/maas/current/preseedsz/var/snap/maas/current/proxyz/var/snap/maas/current/rsyslogz/etc/squid-deb-proxyz	/etc/maasz/var/lib/maas/dhcp*z/var/log/apache2*z/var/log/maas*z/var/log/upstart/maas-*zapt-cache policy maas-*z apt-cache policy python-django-*zmaas-region-controllerzmaas-region dumpdataz"maas %s commissioning-results listrz6Cannot login into MAAS remote API with provided creds.)
r�_is_snapZadd_cmd_outputZadd_forbidden_pathZ
add_copy_specZis_installedrrrZ
_log_errorr
rrr�setupEsT
�
���
���z
Maas.setupcCs"|jrd}nd}|�|dd�dS)Nz(/var/snap/maas/current/maas/regiond.confz/etc/maas/regiond.confz(database_pass\s*:\s*)(.*)z
\1********)rZdo_file_sub)rZregiond_pathrrr�postprocts�z
Maas.postproc)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackages�servicesr�strZoption_listrrrrrr�
__classcell__rrrrrs*����	/rN)Zsos.report.pluginsrrrrrrrr�<module>s