U
    -_g                     @   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 )
SEDUtilityz
    Collects information about SED drives installed on host system.
    This plugin will capture data using sedutil utility
    zSelf Encrypting Drivessedutil)ZsecuritysystemZstorageZhardware)r   debugFzcapture debug data)defaultZdescc                 C   sx   g }|  d}| drtd|d krj|d  D ]8}|dr0| }|d d \}}d|kr0|| q0| | d S )	Nzsedutil-cli --scanr   r   Zstatusoutputz/dev/   2)Zcollect_cmd_outputZ
get_option
splitlines
startswithsplitappenddo_debug)selfsed_listresultlineZdiskZtcg_opal_dev r   </usr/lib/python3/dist-packages/sos/report/plugins/sedutil.pysetup   s    


zSEDUtility.setupc                 C   s   |D ]}|  d|  qdS )z Collect debug logs zsedutil-cli --query N)Zadd_cmd_output)r   r   Zdevicer   r   r   r   ,   s    zSEDUtility.do_debugN)__name__
__module____qualname____doc__Z
short_descZplugin_nameZ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   