o
    *b}                     @   s*   d dl mZmZmZ G dd deeZdS )    )PluginIndependentPlugin	PluginOptc                   @   s@   e Zd ZdZdZdZdZdZedddd	gZ	d
d Z
dd ZdS )SMclizSANtricity storage deviceZsmclienti  )systemZstorageZhardware)ZSMclientdebugFzcapture support debug data)defaultZdescc                    s   g d}g }|  d}|d dkr'|d  D ]}d|v r&|| d  q|D ] |  fdd|D  q)| d	rD| | d S d S )
N)zshow storagearray;zshow storagearray connections;zshow storagearray healthstatus;zSMcli -d -Sstatusr   outputZ	localhostc                    s   g | ]}d  |f qS )zSMcli localhost -n %s -c '%s' ).0subcmdssnamer   =/usr/lib/python3/dist-packages/sos/report/plugins/smclient.py
<listcomp>+   s    
zSMcli.setup.<locals>.<listcomp>r   )Zcollect_cmd_output
splitlinesappendsplitadd_cmd_outputZ
get_optiondo_debug)selfZsubcmdsssnamesresultliner   r   r   setup   s   


zSMcli.setupc                 C   s>   | j dd}d}d}|D ]}| jd||||f |dd qd S )NF)ZmakezSMcli localhost -nz#save storageArray supportData file=z%s %s -c '%s"support-%s";'i  )ZrunatZtimeout)Zget_cmd_output_pathr   )r   r   Zlogpathcmdr   r   r   r   r   r   3   s   zSMcli.do_debugN)__name__
__module____qualname__Z
short_descZplugin_nameZplugin_timeoutZprofilesZpackagesr   Zoption_listr   r   r   r   r   r   r      s    r   N)Zsos.report.pluginsr   r   r   r   r   r   r   r   <module>   s   