1
0
Fork 0

plugins: made class methods from get_config_options* methods

They were intended to be class methods and that's why there
were defined with the 'cls' parameter, but they actually
weren't class methods.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2015-05-26 14:24:07 +02:00
parent 14b8d3ff40
commit 60f9e1e217
13 changed files with 15 additions and 0 deletions

View file

@ -43,10 +43,12 @@ class Plugin(object):
# Plugin configuration manipulation and helpers.
#
@classmethod
def _get_config_options(self):
"""Default configuration options for the plugin."""
return {}
@classmethod
def _get_config_options_used_by_dynamic(self):
"""List of config options used by dynamic tuning. Their previous values will be automatically saved and restored."""
return []

View file

@ -42,6 +42,7 @@ class AudioPlugin(base.Plugin):
except:
return None
@classmethod
def _get_config_options(cls):
return {
"timeout": 0,

View file

@ -32,6 +32,7 @@ class BootloaderPlugin(base.Plugin):
def _instance_cleanup(self, instance):
pass
@classmethod
def _get_config_options(cls):
return {
"grub2_cfg_file": None,

View file

@ -37,6 +37,7 @@ class CPULatencyPlugin(base.Plugin):
self._assigned_devices = set()
self._free_devices = self._devices.copy()
@classmethod
def _get_config_options(self):
return {
"load_threshold" : 0.2,

View file

@ -59,6 +59,7 @@ class DiskPlugin(hotplug.Plugin):
instance._load_monitor.remove_device(device_name)
super(self.__class__, self)._removed_device_unapply_tuning(instance, device_name)
@classmethod
def _get_config_options(cls):
return {
"dynamic" : True, # FIXME: do we want this default?
@ -71,6 +72,7 @@ class DiskPlugin(hotplug.Plugin):
"scheduler_quantum" : None,
}
@classmethod
def _get_config_options_used_by_dynamic(cls):
return [
"apm",

View file

@ -20,6 +20,7 @@ class EeePCSHEPlugin(base.Plugin):
raise exceptions.NotSupportedPluginException("Plugin is not supported on your hardware.")
super(self.__class__, self).__init__(*args, **kwargs)
@classmethod
def _get_config_options(self):
return {
"load_threshold_normal" : 0.6,

View file

@ -53,6 +53,7 @@ class MountsPlugin(base.Plugin):
self._assigned_devices = set()
self._free_devices = self._devices.copy()
@classmethod
def _get_config_options(self):
return {
"disable_barriers": None,

View file

@ -74,6 +74,7 @@ class NetTuningPlugin(base.Plugin):
log.debug("%s load: read %0.2f, write %0.2f" % (device, stats["read"], stats["write"]))
log.debug("%s idle: read %d, write %d, level %d" % (device, idle["read"], idle["write"], idle["level"]))
@classmethod
def _get_config_options(cls):
return {
"wake_on_lan": None,

View file

@ -11,6 +11,7 @@ class ScriptPlugin(base.Plugin):
Plugin for running custom scripts with profile activation and deactivation.
"""
@classmethod
def _get_config_options(self):
return {
"script" : None,

View file

@ -28,6 +28,7 @@ class SelinuxPlugin(base.Plugin):
self._cache_threshold_path = os.path.join(self._selinux_path, "avc", "cache_threshold")
super(self.__class__, self).__init__(*args, **kwargs)
@classmethod
def _get_config_options(self):
return {
"avc_cache_threshold" : None,

View file

@ -21,6 +21,7 @@ class USBPlugin(base.Plugin):
self._free_devices = self._devices.copy()
self._cmd = commands()
@classmethod
def _get_config_options(self):
return {
"autosuspend" : None,

View file

@ -22,6 +22,7 @@ class VideoPlugin(base.Plugin):
self._free_devices = self._devices.copy()
self._cmd = commands()
@classmethod
def _get_config_options(self):
return {
"radeon_powersave" : None,

View file

@ -15,6 +15,7 @@ class VMPlugin(base.Plugin):
Plugin for tuning memory management.
"""
@classmethod
def _get_config_options(self):
return {
"transparent_hugepages" : None,