U
    -_gf                     @   s&   d dl mZmZ G dd deeZdS )    )PluginIndependentPluginc                   @   s(   e Zd ZdZdZdZdd Zdd ZdS )	PcizPCI devicesZpci)Zhardwaresystemc                 C   s6   |  dsdS | d}d|kr*|d t|dkS )z# Check whether PCI devices present /proc/bus/pciFZdevicesr   )Z
path_isdirlistdirremovelen)selfZcontent r   8/usr/lib/python3/dist-packages/sos/report/plugins/pci.pycheck_for_bus_devices   s    


zPci.check_for_bus_devicesc                 C   s6   |  dddg |  r2| jdddd | d d S )Nz/proc/ioportsz/proc/iomemr   zlspci -nnvvZlspci)Zroot_symlinkZtagsz	lspci -tv)Zadd_copy_specr   Zadd_cmd_output)r
   r   r   r   setup   s    z	Pci.setupN)__name__
__module____qualname__Z
short_descZplugin_nameZprofilesr   r   r   r   r   r   r      s
   r   N)Zsos.report.pluginsr   r   r   r   r   r   r   <module>	   s   