1
0
Fork 0
tuned/commands/cmd_list.py
Marcela Mašláňová 9d168d837d Rewrite commands only to: default, help, list, modes, off.
The different modes could be specified in /etc/tune-profiles
and then can be listed by list:
tuned-adm list
and set by:
tuned-adm modes YourFavourite
2009-07-30 16:30:52 +02:00

33 lines
867 B
Python

# -*- coding: utf-8 -*-
import os
import os.path
import glob
import kobo.shortcuts
from kobo.cli import Command
class List(Command):
"""list of modes"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s" % self.normalized_name
self.parser.add_option(
"--show-disabled",
default=False,
action="store_true",
help="show disabled workers"
)
def run(self, *args, **kwargs):
# link config files into directory which is exectued by ktune
if os.path.exists("/etc/tune-profiles/"):
modes = os.listdir("/etc/tune-profiles")
if len(modes) > 0:
print "Modes: "
for i in range(len(modes)):
print modes[i]
else:
print "No other profiles than default defined."