• File: plugin_scsi_host.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyc
  • Date Modified: 09/21/2022 11:48 AM
  • File size: 5.01 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

\c@sddlZddlmZddlTddlZddljZddlm	Z	ddl
Z
ddlZejj
ZdejfdYZdS(iNi(thotplug(t*(tcommandstSCSIHostPlugincBseZdZdZdZdZedZdZdZ	dZ
dZd	Zed
Z
dZdZd
ZeddedZededZRS(s,
	Plugin for tuning options of SCSI hosts.
	cOs)tt|j||t|_dS(N(tsuperRt__init__Rt_cmd(tselftargstkwargs((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyRscCsztt|jt|_t|_x?|jjdD]+}|j	|r;|jj
|jq;q;Wt|_dS(Ntscsi(
RRt
_init_devicestTruet_devices_supportedtsett
_free_devicest_hardware_inventorytget_devicest_device_is_supportedtaddtsys_namet_assigned_devices(Rtdevice((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyRs	cCs&g|D]}|jjd|^qS(NR
(Rt
get_device(Rtdevicestx((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_get_device_objects scCs
|jdkS(Nt	scsi_host(tdevice_type(tclsR((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyR#scCs|jj|d|jdS(NR
(Rt	subscribet_hardware_events_callback(R((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_hardware_events_init'scCs|jj|dS(N(Rtunsubscribe(R((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_hardware_events_cleanup*scCs/|j|r+tt|j||ndS(N(RRRR(RteventR((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyR-scCstt|j||dS(N(RRt_added_device_apply_tuning(Rtinstancetdevice_name((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyR$1scCstt|j||dS(N(RRt_removed_device_unapply_tuning(RR%R&((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyR'4scCsidd6S(Ntalpm(tNone(R((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_get_config_options7scCst|_t|_dS(N(Rt_has_static_tuningtFalset_has_dynamic_tuning(RR%((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_instance_init=s	cCsdS(N((RR%((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_instance_cleanupAscCstjjdt|dS(Ns/sys/class/scsi_host/tlink_power_management_policy(tostpathtjointstr(RR((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt_get_alpm_policy_fileDsR(t
per_devicecCsu|dkrdS|j|}|sqtjj|rM|jj||qqtjd|t	|fdSn|S(NsBALPM control file ('%s') not found, skipping ALPM setting for '%s'(
R)R5R1R2texistsRt
write_to_filetlogtinfoR4(RtpolicyRtsimtpolicy_file((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt	_set_alpmGscCsA|j|}|jj|dtj}|dkr=|SdS(Ntno_errort(R5Rt	read_fileRtstripR)(RRtignore_missingR=R;((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt	_get_alpmTs(t__name__t
__module__t__doc__RRRtclassmethodRR R"RR$R'R*R.R/R5tcommand_setRR>tcommand_getR,RD(((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyRs"		
									
	(terrnoR@Rt
decoratorst
tuned.logsttunedttuned.conststconststtuned.utils.commandsRR1tretlogstgetR9tPluginR(((sB/usr/lib/python2.7/site-packages/tuned/plugins/plugin_scsi_host.pyt<module>s