1
0
Fork 0
tuned/commands/cmd_personal_mode.py
Marcela Mašláňová 9490bc08b3 Specified commands for tuned-adm (default, server, off).
Start to use gitignore.
2009-07-27 16:36:24 +02:00

40 lines
953 B
Python

# -*- coding: utf-8 -*-
import os
import sys
import kobo.shortcuts
from kobo.cli import Command
class Personal(Command):
"""set personal mode"""
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):
# call script with personal setting from /etc/ktune.d/
if len(args) != 1:
self.parser.error("Argument missing.")
name_p = args[0]
show_disabled = kwargs.pop("show_disabled")
try:
# for include two strings into function: % (foo, foo)
#retcode, output = kobo.shortcuts.run('/etc/ktune.d/%s.sh' % name_p)
pass
except RuntimeError, ex:
print str(ex)
sys.exit(1)