ó
ÍÿŠTc           @   sF   d  d l  Z  d  d l m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   getProcessOutput(   t   ManagerPlugint   HardwareInfoc           B   sJ   e  Z d  Z d Z d
 Z e Z d Z d „  Z d „  Z	 d „  Z
 d „  Z RS(   s*   A plugin to retrieve hardware information.s   hardware-infoi<   i   s   /usr/bin/lshwc         C   s0   t  t |  ƒ j | ƒ |  j |  j |  j ƒ d  S(   N(   t   superR   t   registert   call_on_acceptedt   message_typet   send_message(   t   selft   registry(    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyR      s    c         C   s   |  j  j j |  j |  j ƒ S(   N(   R	   t   brokert   call_if_acceptedR   R   (   R   (    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyt   run   s    c         C   s:   t  |  j d d d g d t j d d  ƒ} | j |  j ƒ S(   Nt   argss   -xmls   -quiett   envt   path(   R    t   commandt   ost   environt   Nonet   addCallbackt   _got_output(   R   t   result(    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyR      s    'c         C   s0   i |  j  d 6| d 6} |  j j j | |  j ƒ S(   Nt   typet   data(   R   R	   R
   R   t   _session_id(   R   t   outputt   message(    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyR      s    i  i€Q (   t   __name__t
   __module__t   __doc__R   t   run_intervalt   Truet   run_immediatelyR   R   R   R   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyR      s   			(   R   t   twisted.internet.utilsR    t   landscape.manager.pluginR   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/landscape/manager/hardwareinfo.pyt   <module>   s   