Blame SOURCES/tuna-Remove-finally-block-in-get_policy_and_rtprio.patch

ad7215
From adba6d6cad1a5c9f062dcf5ee4b4be40d4dc134f Mon Sep 17 00:00:00 2001
ad7215
From: Leah Leshchinsky <lleshchi@redhat.com>
ad7215
Date: Wed, 2 Feb 2022 15:18:29 -0500
ad7215
Subject: [PATCH 3/5] tuna: Remove finally block in get_policy_and_rtprio
ad7215
ad7215
The implementation of the error handling block in
ad7215
tuna.get_policy_and_rtprio() caused the exceptions raised by
ad7215
tuna_sched.Policy to be consumed by the finally block.
ad7215
When an invalid policy is passed via the '--priority' flag,
ad7215
this consumption of the exception causes tuna to fail silently.
ad7215
ad7215
Remove the finally block in tuna.get_policy_and_rtprio().
ad7215
ad7215
Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
ad7215
Signed-off-by: John Kacur <jkacur@redhat.com>
ad7215
ad7215
diff --git a/tuna/tuna.py b/tuna/tuna.py
ad7215
index 126990339985..31707c9cb69c 100755
ad7215
--- a/tuna/tuna.py
ad7215
+++ b/tuna/tuna.py
ad7215
@@ -520,8 +520,8 @@ def get_policy_and_rtprio(parm):
ad7215
             rtprio = int(parms[1])
ad7215
         elif cp.is_rt():
ad7215
             rtprio = 1
ad7215
-    finally:
ad7215
-        return(policy, rtprio)
ad7215
+
ad7215
+    return (policy, rtprio)
ad7215
 
ad7215
 def thread_filtered(tid, cpus_filtered, show_kthreads, show_uthreads):
ad7215
     if cpus_filtered:
ad7215
-- 
ad7215
2.27.0
ad7215