summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Oros <poros@redhat.com>2014-02-04 07:09:28 +0100
committerJiri Kastner <jkastner@redhat.com>2014-02-04 12:25:42 +0100
commit37ea85768b8cff7b47acbed74687b3b4513f03b8 (patch)
tree1624b9d9cfa19bc2c1d3379a3dbc6eda3d5ed55c
parent029deca251faeea85b1fae64d79d9ba8af7dcec4 (diff)
downloadtuna-37ea85768b8cff7b47acbed74687b3b4513f03b8.tar.gz
CLI: fix traceback when -p is used with unsupported value
CLI: fix traceback when -p is used with unsupported value $ tuna -t 4364 -p fif Traceback (most recent call last): File "/usr/bin/tuna", line 647, in <module> main() File "/usr/bin/tuna", line 531, in main tuna.threads_set_priority(thread_list, a, affect_children) File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 502, in threads_set_priority rtprio = int(parms[0]) ValueError: invalid literal for int() with base 10: 'fif' Signed-off-by: Petr Oros <poros@redhat.com> Tested-by: Jiri Kastner <jkastner@redhat.com> Signed-off-by: Jiri Kastner <jkastner@redhat.com>
-rwxr-xr-xtuna/tuna.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tuna/tuna.py b/tuna/tuna.py
index 0feb521..49c9eab 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -498,8 +498,11 @@ def threads_set_priority(tids, parm, affect_children = False):
rtprio = int(parms[1])
elif parms[0].upper() in ["FIFO", "RR"]:
rtprio = 1
- else:
+ elif parms[0].isdigit():
rtprio = int(parms[0])
+ else:
+ print "tuna: " + _("\"%s\" is unsupported priority value!") % parms[0]
+ return
for tid in tids:
try: