live
     KŇ×"sŔŐ .    K# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution for further information.

from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
import os


class Pci(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
    """PCI devices
    """

    plugin_name = "pci"
    profiles = ('hardware', 'system')

    def check_for_bus_devices(self):
        if not os.path.isdir('/proc/bus/pci'):
            return False
        # ensure that more than just the 'devices' file, which can be empty,
        # exists in the pci directory. This implies actual devices are present
        content = os.listdir('/proc/bus/pci')
        if 'devices' in content:
            content.remove('devices')
        return len(content) > 0

    def setup(self):
        self.add_copy_spec([
            "/proc/ioports",
            "/proc/iomem",
            "/proc/bus/pci"
        ])

        if self.check_for_bus_devices():
            self.add_cmd_output("lspci -nnvv", root_symlink="lspci")
            self.add_cmd_output("lspci -tv")

# vim: set et ts=4 sw=4 :
  #   Mlßi~ĘC]q@ťp.\ĹŁŘ­źçÁÖ ?÷     Mó
Mc           @   s  d  Z  d d l m Z m Z m Z d d l Z d d l m Z d d l m Z m	 Z	 m
 Z
 m Z d d l m Z m Z m Z m Z m Z m Z d d l m Z m Z d d	 d
 g Z d Z d e f d     YZ d	 e f d     YZ d
 e j e f d     YZ d S(   s   Several classes and functions that help with integrating and using Babel
in applications.

.. note: the code in this module is not used by Babel itself
i˙˙˙˙(   t   datet   datetimet   timeN(   t   Locale(   t   format_datet   format_datetimet   format_timet   LC_TIME(   t   format_numbert   format_decimalt   format_currencyt   format_percentt   format_scientifict
   LC_NUMERIC(   t   sett   UTCt   Formatt	   LazyProxyt   Translationss   restructuredtext enc           B   sz   e  Z d  Z d d  Z d d d  Z d d d  Z d d d  Z d   Z d d  Z	 d   Z
 d d	  Z d
   Z RS(   s  Wrapper class providing the various date and number formatting functions
    bound to a specific locale and time-zone.
    
    >>> fmt = Format('en_US', UTC)
    >>> fmt.date(date(2007, 4, 1))
    u'Apr 1, 2007'
    >>> fmt.decimal(1.2345)
    u'1.234'
    c         C   s   t  j |  |  _ | |  _ d S(   sˇ   Initialize the formatter.
        
        :param locale: the locale identifier or `Locale` instance
        :param tzinfo: the time-zone info (a `tzinfo` instance or `None`)
        N(   R   t   parset   localet   tzinfo(   t   selfR   R   (    (    s1   /usr/lib/python2.7/site-packages/babel/support.pyt   __init__,   s    t   mediumc         C   s   t  | | d |  j S(   sÚ   Return a date formatted according to the given pattern.
        
        >>> fmt = Format('en_US')
        >>> fmt.date(date(2007, 4, 1))
        u'Apr 1, 2007'
        
        :see: `babel.dates.format_date`
        R   (   R   R   (   R   R    t   format(    (    s1   /usr/lib/python2.7/site-packages/babel/support.pyR    5   s    	c         C   s   t  | | d |  j d |  j S(   sH  Return a date and time formatted according to the given pattern.
        
        >>> from pytz import timezone
        >>> fmt = Format('en_US', tzinfo=timezone('US/Eastern'))
        >>> fmt.datetime(datetime(2007, 4, 1, 15, 30))
        u'Apr 1, 2007 11:30:00 AM'
        
        :see: `babel.dates.format_datetime`
        R   R   (   R   R   R   (   R   R   R   (    (    s1   /usr/lib/python2.7/site-packages/babel/support.pyR   @   s    
c         C   s   t  | | d |  j d |  j S(   s+  Return a time formatted according to the given pattern.
        
        >>> from pytz i