ó
0ĹZc           @   sb   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d e f d     YZ d S(   i˙˙˙˙Nt   UptrackDepSolverc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   sF   | |  _  | j |  _ t j |  j j d  |  _ | |  _ | |  _ d  S(   Nt   actions(	   t   local_statust   client_configt   configt	   posixpatht   joint   remotet
   server_urlt   installed_update_idst   locked_update_ids(   t   selft   localR	   R
   (    (    s0   /usr/lib/pymodules/python2.7/UptrackDepSolver.pyt   __init__   s
    		c         C   sĐ  t  j | d d d t d t } yn t j   } t  j   } | j t j |  j  | j t j	 d | f g  | j t j
 | j  | j   Wn/ t j d d d t  j t  j d   n X| j t j  } | d	 k r:t j d
 |  d | k od k n rt  j  q:t  j t  j d | j     n  t  j | j    } d | k rr|  j j | d  n  d | k r­| d r­|  j j r­|  j j   |  j _ n  d | k rĚ| d |  j _ n  | S(   Nt   versioni   t   explicit_startt   explicit_endt   requests'   Request to the dependency solver failedt   exc_infosh   An error occurred requesting upgrade plans from the server. Check your
network connection and try again.iČ   s"   Received HTTP %03d from the serveriô  iW  s/   The Ksplice Uptrack server reported the error:
t   Backofft   RegenerateUUIDt   RemovableModules(   i   i   (   t   Uptrackt	   yaml_dumpt   Truet   StringIOt   getCurlt   setoptt   pycurlt   URLR   t   HTTPPOSTt   WRITEFUNCTIONt   writet   performt   loggingt   debugt   ResultExceptiont   ERROR_NO_NETWORKt   getinfot   RESPONSE_CODEt   server_error_exceptiont   ERROR_INTERNAL_SERVER_ERRORt   getvaluet	   yaml_loadR   t   updateBackofft   use_hw_uuidt   newUUIDt   newuuidt   removableModules(   R   R   t   contentst   st   ct   rcodet   response(    (    s0   /usr/lib/pymodules/python2.7/UptrackDepSolver.pyt   _sendRequest)   s>    
c         C   sÉ   i  } t  j j |  j | d |  j t j j   | d <i  | d <d | d d <|  j j | d d <|  j j | d d <| | d d <|  j	 | d d	 <|  j
 | d d
 <|  j j | d d <|  j |  S(   NR   t   Timet   Commandt
   getPlansExt   Actiont   Cront   Autoinstallt   Actionss   Already Installedt   Lockeds   Modules Loaded(   R   t   Statust   addIdentityR   R   t   datetimet   utcnowt   cront   cron_autoinstallR	   R
   t   modulesR6   (   R   R   t   req(    (    s0   /usr/lib/pymodules/python2.7/UptrackDepSolver.pyt   getPlansT   s    
(   t   __name__t
   __module__R   R6   RG   (    (    (    s0   /usr/lib/pymodules/python2.7/UptrackDepSolver.pyR       s   	
	+(	   RA   R   t	   cStringIOR   R"   R   R   t   objectR    (    (    (    s0   /usr/lib/pymodules/python2.7/UptrackDepSolver.pyt   <module>   s   