File fix_unit_configuration_reading.patch of Package tuned
From: Tomas Korbar <tkorbar@redhat.com>
Subject: Fix unit configuration reading
References: Bugfix found by git HEAD review
Patch-Mainline: v2.11.0-rc.1
Git-commit: 2b543b0a5a81e9a100e5bb148324a3ca9aa5aeea
Git-repo: https://github.com/openSUSE/tuned.git
Append "1" to Unit configuration check for
enabled and replace values
Resolves: rhbz#1613379
Signed-off-by: Thomas Renninger <trenn@suse.com>
diff --git a/tuned/profiles/unit.py b/tuned/profiles/unit.py
index 3052a81..f944d1d 100644
--- a/tuned/profiles/unit.py
+++ b/tuned/profiles/unit.py
@@ -11,8 +11,8 @@ class Unit(object):
def __init__(self, name, config):
self._name = name
self._type = config.pop("type", self._name)
- self._enabled = config.pop("enabled", True) in [True, "true", 1]
- self._replace = config.pop("replace", False) in [True, "true", 1]
+ self._enabled = config.pop("enabled", True) in [True, "true", 1, "1"]
+ self._replace = config.pop("replace", False) in [True, "true", 1, "1"]
self._devices = config.pop("devices", "*")
self._devices_udev_regex = config.pop("devices_udev_regex", None)
self._script_pre = config.pop("script_pre", None)