MINI MINI MANI MO

Path : /usr/lib/python2.7/site-packages/tuned/plugins/
File Upload :
Current File : //usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyo

ó
©=[c@sddlmZddlZddlZddlZddlTddlZddl	Tddl
mZejj
ƒZdejfd„ƒYZdS(i(tbaseiÿÿÿÿN(t*(tcommandstSysfsPlugincBsbeZdZd„Zd„Zd„Zd„Zd„Zed„Z	d„Z
d„Zd	„ZRS(
sR
	Plugin for applying custom sysfs options, using specific plugins is preferred.
	cOs2tt|ƒj||Žt|_tƒ|_dS(N(tsuperRt__init__tTruet_has_dynamic_optionsRt_cmd(tselftargstkwargs((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyRs	cCsjt|_t|_tgt|jjƒƒD]&}tj	j
|dƒ|df^q+ƒ|_i|_dS(Nii(
tFalset_has_dynamic_tuningRt_has_static_tuningtdicttlisttoptionstitemstostpathtnormpatht_sysfst_sysfs_original(R	tinstancet	key_value((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt_instance_inits		KcCsdS(N((R	R((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt_instance_cleanupscCsŸx˜t|jjƒƒD]\}}|jj|ƒ}x`tj|ƒD]O}|j|ƒr‚|j|ƒ|j	|<|j
||ƒqDtjd|ƒqDWqWdS(Ns)rejecting write to '%s' (not inside /sys)(
RRRt
_variablestexpandtglobtiglobt_check_sysfst_read_sysfsRt_write_sysfstlogterror(R	Rtkeytvaluetvtf((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt_instance_apply_static"s"c	Cs¤t}x—t|jjƒƒD]€\}}|jj|ƒ}x_tj|ƒD]N}|j|ƒrJ|j	|ƒ}|j
||||ƒtkr˜t}q˜qJqJWqW|S(N(RRRRRRRRR R!t
_verify_valueR(	R	Rtignore_missingtretR%R&R'R(tcurr_val((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt_instance_verify_static,s"cCs:x3t|jjƒƒD]\}}|j||ƒqWdS(N(RRRR"(R	Rt
full_rollbackR%R&((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt_instance_unapply_static7s"cCstjd|ƒS(Ns^/sys/.*(tretmatch(R	t
sysfs_file((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyR ;scCsE|jj|ƒjƒ}t|ƒdkr=|jj|tƒSdSdS(Ni(Rt	read_filetstriptlentget_active_optionRtNone(R	R3tdata((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyR!>scCs|jj||ƒS(N(Rt
write_to_file(R	R3R&((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyR"Es(
t__name__t
__module__t__doc__RRRR)R.RR0R R!R"(((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyRs				
			(tRRR1tos.pathRt
decoratorst
tuned.logsttunedt
subprocessttuned.utils.commandsRtlogstgetR#tPluginR(((s>/usr/lib/python2.7/site-packages/tuned/plugins/plugin_sysfs.pyt<module>s



OHA YOOOO