o
    O6uf
  ã                   @   s&   d dl mZmZ G dd„ deeƒZdS )é    )ÚPluginÚRedHatPluginc                   @   s,   e Zd ZdZdZdZdZdd„ Zdd„ Zd	S )
ÚSaphanazSAP HANAÚsaphana)Úsap)z/hanac                 C   s$  g }|   d¡rŽ|  d¡}|D ]}t|ƒdkr| ¡ }| |¡ q|D ]m}| ¡ › d�}d|› d�}| j|› d�|› d�d� | j|› d	�|› d
�d� | j|› d�|› d�d� | j|› d�|› d�d� |   d|› d�¡r�|  d|› d�¡D ]}d|v rŒ| ¡ dd … }|  |||¡ qwq"d S d S )Nz/hana/sharedé   Úadmzsu - z -cz "HDB info"Ú	_HDB_info©Úsuggest_filenamez "hdbsrvutil -v"Ú_versionz 'hdbcons "mm l -s -S -p"'Ú	_memusagezS 'hdbcons -e hdbindexserver                                     "replication info"'Ú_replicainfoz/hana/shared/ú/ÚHDBéþÿÿÿ)Ú
path_isdirÚlistdirÚlenÚstripÚappendÚlowerÚadd_cmd_outputÚget_inst_info)ÚselfÚsidsÚsharedÚsidÚsidadmÚprefixÚinst© r!   ú</usr/lib/python3/dist-packages/sos/report/plugins/saphana.pyÚsetup   s>   


€ÿÿÿþ€äzSaphana.setupc           	      C   sx   d}|› d|› d�}| j |||f |d� d|› d|› d�}|  |¡r:d}|› d|› d	�}| j |||f |d� d
S d
S )z! Collect the given instance info z7su - %s -c "sapcontrol -nr %s -function GetProcessList"Ú_Ú_statusr
   z	/usr/sap/z/HDBz/exe/python_supportz4su - %s -c "python %s/landscapeHostConfiguration.py"Ú_landscapeConfigN)r   r   )	r   r   r   r    Úproc_cmdÚstatus_fnameÚpathÚpy_cmdÚpy_fnamer!   r!   r"   r   5   s   
þ


þýzSaphana.get_inst_infoN)	Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesÚfilesr#   r   r!   r!   r!   r"   r      s    "r   N)Úsos.report.pluginsr   r   r   r!   r!   r!   r"   Ú<module>   s   