ok

Mini Shell

Direktori : /proc/self/root/usr/lib/python2.7/site-packages/tuned/utils/
Upload File :
Current File : //proc/self/root/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyc

�
��\c@sddlZddlZddlZddlZddlZddlmZmZeZ	y=ej
�dkr�ej�dkr�ddlZe
Z	nWnnXyddlZe
ZWn
eZnXddljZddlZdd	lmZejj�Zd
d
d��YZdS(i����N(t	ConfigObjtConfigObjErroriti386ti486ti586ti686tx86_64(tcommandstProfileRecommendercBs)eZd�Zed�Zed�ZRS(cCst�|_dS(N(Rt	_commands(tself((sC/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyt__init__scCsXtj}|r|Stj�dk}|s;tjd�n|jtjd|�}|dk	rc|Si}x�tj	D]�}g}ytj
|�}Wn?tk
r�}|jtj
kr�tjd||f�q�nXx-|D]%}	tjj||	�}
|
||	<q�WqsWxIt|j��D]5}	||	}
|j|
d|�}|dk	r|SqW|S(NistProfile recommender is running without root privileges. Profiles with virt recommendation condition will be omitted.thas_rootserror accessing %s: %s(tconststDEFAULT_PROFILEtostgeteuidtlogtwarningtprocess_configtRECOMMEND_CONF_FILEtNonetRECOMMEND_DIRECTORIEStlistdirtOSErrorterrnotENOENTterrortpathtjointsortedtkeys(R
t	hardcodedtprofileRtmatchingtfilest	directorytcontentstetnameR((sC/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyt	recommend s6		

c	Cs�d}yetjj|�sdSt|dtdt�}x0t|j��D]}t}x�t||j��D]�}|||}|dkr�d}n|dkr�|s�t}Pnt	j
||jjdg�dt	j
�s7t}q7qm|dkr(t	j
||jjtj�t	j
�s7t}q7qm|d	d
kr|tjj|�spt	j
||jj|�t	j
�r7t}q7qm|d	d!dkr�tj�}	|	j�t|	jt	j|���d	kr7t}q7qm|d
krTtr@xgtj�j�D]9}
|
ddjd�}t	j
||t	j�r�Pq�q�Wt}q7tjd|�qm|dkrmt r#t!j"j#t!j"j$dt�}d}
y|j�|j%d}
WnQt&t't(fk
r�}t)|d�r�|j*t*j+kr�tj,d|�q�nXt	j
||
t	j�dkr4t}q4q7tj,d|�qmqmW|rJt	jd�}|j-d|�}PqJqJWWn3t&t't.fk
r�}tj,d||f�nX|S(Ntlist_valuest
interpolationts^$tvirts	virt-whatitsystemit/itprocesstchassis_typetdatatTypetasciisCIgnoring 'chassis_type' in '%s',								dmidecode is not available.tsyspurpose_roletraise_on_errortroleRs/Failed to load the syspurpose										file: %ss[Failed to process 'syspurpose_role' in '%s'								, the syspurpose module is not availables,[^,]*$serror processing '%s', %s(/RRRtisfileRtFalsetlistRtTruetretmatchR	texecutetSt	read_fileR
tSYSTEM_RELEASE_FILEtexiststprocfstpidstatstreload_threadstlent
find_by_regextcompilethave_dmidecodet	dmidecodetchassistvaluestdecodet
IGNORECASERtdebugthave_syspurposet
syspurposeR#tSyspurposeStoretUSER_SYSPURPOSER%tIOErrorRtKeyErrorthasattrRRRtsubR(R
tfnameRtmatching_profiletconfigtsectionR<toptiontvaluetpsRJR0tsR6R&tr((sC/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyR=s�		"		
$				
!(t__name__t
__module__RR8R(R:R(((sC/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyRs	(RRRRR((RR;RRBtplatformt	configobjRRR8RHRtmachineRIR:tsyspurpose.filesRPROttuned.constsR
t
tuned.logsttunedttuned.utils.commandsRtlogstgetRR(((sC/usr/lib/python2.7/site-packages/tuned/utils/profile_recommender.pyt<module>s,$




Zerion Mini Shell 1.0