From 18317edd37f57a2d39cff94f286641eaba007ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Fri, 22 Nov 2024 10:06:49 +0100 Subject: [PATCH] tuned-ppd: Remove the use of StrEnum To be compatible with Python 3.9. Resolves: RHEL-68208 --- tuned/ppd/controller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tuned/ppd/controller.py b/tuned/ppd/controller.py index 4376c1e9..bb2746ab 100644 --- a/tuned/ppd/controller.py +++ b/tuned/ppd/controller.py @@ -2,7 +2,7 @@ from tuned.utils.commands import commands from tuned.consts import PPD_CONFIG_FILE from tuned.ppd.config import PPDConfig, PPD_PERFORMANCE, PPD_POWER_SAVER -from enum import StrEnum +from enum import Enum import threading import dbus import os @@ -18,7 +18,7 @@ UPOWER_DBUS_PATH = "/org/freedesktop/UPower" UPOWER_DBUS_INTERFACE = "org.freedesktop.UPower" -class PerformanceDegraded(StrEnum): +class PerformanceDegraded(Enum): NONE = "" LAP_DETECTED = "lap-detected" HIGH_OPERATING_TEMPERATURE = "high-operating-temperature" @@ -128,9 +128,9 @@ def _check_performance_degraded(self): if os.path.exists(LAP_MODE_PATH) and self._cmd.read_file(LAP_MODE_PATH).strip() == "1": performance_degraded = PerformanceDegraded.LAP_DETECTED if performance_degraded != self._performance_degraded: - log.info("Performance degraded: %s" % performance_degraded) + log.info("Performance degraded: %s" % performance_degraded.value) self._performance_degraded = performance_degraded - exports.property_changed("PerformanceDegraded", performance_degraded) + exports.property_changed("PerformanceDegraded", performance_degraded.value) def initialize(self): self._profile_holds = ProfileHoldManager(self) @@ -216,7 +216,7 @@ def get_actions(self): @exports.property_getter("PerformanceDegraded") def get_performance_degraded(self): - return self._performance_degraded + return self._performance_degraded.value @exports.property_getter("ActiveProfileHolds") def get_active_profile_holds(self):