ok
Direktori : /usr/lib/python2.7/site-packages/tuned/utils/ |
Current File : //usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyo |
� ��\c @ s d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z e Z y= e j � d k r� e j � d k r� d d l Z e Z n Wn n Xy d d l Z e Z Wn e Z n Xd d l j Z d d l Z d d l m Z e j j � Z d d d � � YZ d S( i����N( t ConfigObjt ConfigObjErrori t i386t i486t i586t i686t x86_64( t commandst ProfileRecommenderc B s) e Z d � Z e d � Z e d � Z RS( c C s t � | _ d S( N( R t _commands( t self( ( sC /usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyt __init__ s c C sX t j } | r | St j � d k } | s; t j d � n | j t j d | �} | d k rc | Si } x� t j D]� } g } y t j | � } Wn? t k r� } | j t j k r� t j d | | f � q� n Xx- | D]% } t j j | | � } | | | <q� Wqs WxI t | j � � D]5 } | | } | j | d | �} | d k r| SqW| S( Ni st Profile recommender is running without root privileges. Profiles with virt recommendation condition will be omitted.t has_roots error accessing %s: %s( t constst DEFAULT_PROFILEt ost geteuidt logt warningt process_configt RECOMMEND_CONF_FILEt Nonet RECOMMEND_DIRECTORIESt listdirt OSErrort errnot ENOENTt errort patht joint sortedt keys( R t hardcodedt profileR t matchingt filest directoryt contentst et nameR ( ( sC /usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyt recommend s6 c C s� d } yet j j | � s d St | d t d t �} x0t | j � � D]} t } x�t | | j � � D]�} | | | } | d k r� d } n | d k r� | s� t } Pn t j | | j j d g � d t j � s7t } q7qm | d k r(t j | | j j t j � t j � s7t } q7qm | d d k r|t j j | � spt j | | j j | � t j � r7t } q7qm | d d !d k r�t j � } | j � t | j t j | � � � d k r7t } q7qm | d k rTt r@xg t j � j � D]9 } | d d j d � } t j | | t j � r�Pq�q�Wt } q7t j d | � qm | d k rm t r#t! j"