refs #21, disk: fix scheduler reading and applying
This commit is contained in:
parent
ee34338cc2
commit
0501e1461e
2 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import base
|
||||
from decorators import *
|
||||
import tuned.logs
|
||||
import tuned.utils.commands
|
||||
|
||||
import os
|
||||
|
||||
|
|
@ -139,9 +140,14 @@ class DiskPlugin(base.Plugin):
|
|||
|
||||
@command_get("elevator")
|
||||
def _get_elevator(self, device):
|
||||
# TODO: ticket #21, does not work
|
||||
sys_file = self._elevator_file(device)
|
||||
return tuned.utils.commands.read_file(sys_file)
|
||||
# example of scheduler file content:
|
||||
# noop deadline [cfq]
|
||||
schedulers = tuned.utils.commands.read_file(sys_file).split()
|
||||
for scheduler in schedulers:
|
||||
if scheduler[0] == "[" and scheduler[-1] == "]":
|
||||
return scheduler[1:-1]
|
||||
return schedulers[0]
|
||||
|
||||
def _alpm_policy_files(self):
|
||||
policy_files = []
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import tuned.logs
|
||||
|
||||
import copy
|
||||
import os
|
||||
from subprocess import *
|
||||
|
||||
__all__ = ["write_to_file", "read_file", "execute"]
|
||||
|
||||
log = tuned.logs.get()
|
||||
|
||||
def write_to_file(f, data):
|
||||
|
|
|
|||
Loading…
Reference in a new issue