tuned/0002-get-CPE-string-from-etc-os-release-rather-than-the-m.patch
Alexander Stefanov 7452f54a15 2.15.0
2021-02-05 19:53:04 +00:00

31 lines
1.5 KiB
Diff

diff -up tuned-2.14.0/tuned/consts.py.1~ tuned-2.14.0/tuned/consts.py
--- tuned-2.14.0/tuned/consts.py.1~ 2020-06-15 11:26:48.000000000 +0200
+++ tuned-2.14.0/tuned/consts.py 2020-07-23 21:56:04.446648685 +0200
@@ -64,7 +64,7 @@ LOG_FILE_COUNT = 2
LOG_FILE_MAXBYTES = 100*1000
LOG_FILE = "/var/log/tuned/tuned.log"
PID_FILE = "/run/tuned/tuned.pid"
-SYSTEM_RELEASE_FILE = "/etc/system-release-cpe"
+OS_RELEASE_FILE = "/etc/os-release"
# prefix for functions plugins
FUNCTION_PREFIX = "function_"
# prefix for exported environment variables when calling scripts
diff -up tuned-2.14.0/tuned/utils/profile_recommender.py.1~ tuned-2.14.0/tuned/utils/profile_recommender.py
--- tuned-2.14.0/tuned/utils/profile_recommender.py.1~ 2020-07-23 21:56:04.446648685 +0200
+++ tuned-2.14.0/tuned/utils/profile_recommender.py 2020-07-23 21:58:22.473174174 +0200
@@ -78,11 +78,10 @@ class ProfileRecommender:
self._commands.execute(["virt-what"])[1], re.S):
match = False
elif option == "system":
- if not re.match(value,
- self._commands.read_file(
- consts.SYSTEM_RELEASE_FILE,
- no_error = True), re.S):
- match = False
+ regex = re.search('CPE_NAME="(.*)"', self._commands.read_file(consts.OS_RELEASE_FILE))
+ cpe = ("" if regex is None else regex.groups()[0])
+ if not re.match(value, cpe, re.S):
+ match = False
elif option[0] == "/":
if not os.path.exists(option) or not re.match(value,
self._commands.read_file(option), re.S):