관리-도구
편집 파일: inventory.cpython-36.pyc
3 �<�e3 � @ sP d dl Z d dlZd dlmZ dgZejj� ZG dd� de�Z G dd� de�Z dS )� N)�consts� Inventoryc @ s\ e Zd ZdZddd�Zdd� Zdd � Zd d� Zdd � Zdd� Z dd� Z dd� Zddd�ZdS )r z� Inventory object can handle information about available hardware devices. It also informs the plugins about related hardware events. NTc C s� |d k r|| _ n tj� | _ |d kr(tj}|j| j �| _|d krDtj}|rxy| jj|� W n t k rv t jd� Y nX |d kr�t� }|| _ d | _i | _d S )NzLcannot set udev monitor receive buffer size, we are probably running inside zIcontainer or with limited capabilites, TuneD functionality may be limitedz�cannot set udev monitor receive buffer size, we are probably running inside container or with limited capabilites, TuneD functionality may be limited)� _udev_context�pyudevZContextZMonitorZfrom_netlink� _udev_monitorr ZCFG_DEF_UDEV_BUFFER_SIZE�set_receive_buffer_size�EnvironmentError�log�warn�_MonitorObserverFactory�_monitor_observer_factory�_monitor_observer�_subscriptions)�selfZudev_contextZudev_monitor_clsZmonitor_observer_factory�buffer_sizer � r �/usr/lib/python3.6/inventory.py�__init__ s&