Discussion:
[PATCH 1/2] CLI: fix traceback due unavailable display
Petr Oros
2013-12-03 11:13:54 UTC
Permalink
Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuna/config.py b/tuna/config.py
index e446447..77cc4d8 100644
--- a/tuna/config.py
+++ b/tuna/config.py
@@ -1,5 +1,5 @@
import io, os, re, fnmatch
-import sys, gtk, pygtk
+import sys, pygtk
import codecs, ConfigParser
from time import localtime, strftime
from subprocess import Popen, PIPE, STDOUT, call
--
1.8.4.2
Petr Oros
2013-12-03 11:13:55 UTC
Permalink
Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/tuna.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tuna/tuna.py b/tuna/tuna.py
index 6dfe740..4e7a0f2 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -490,10 +490,14 @@ def thread_set_priority(tid, policy, rtprio):

def threads_set_priority(tids, parm, affect_children = False):
parms = parm.split(":")
+ rtprio = -1
policy = None
- if len(parms) != 1:
+ if parms[0].upper() in ["OTHER", "BATCH", "IDLE", "FIFO", "RR", "IDLE", "RESET_ON_FORK"]:
policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
- rtprio = int(parms[1])
+ if len(parms) > 1:
+ rtprio = int(parms[1])
+ else:
+ rtprio = 0
else:
rtprio = int(parms[0])
--
1.8.4.2
John Kacur
2013-12-03 12:16:52 UTC
Permalink
Where's the changelog? there are zero comments here.

----- Original Message -----
Post by Petr Oros
Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tuna/config.py b/tuna/config.py
index e446447..77cc4d8 100644
--- a/tuna/config.py
+++ b/tuna/config.py
@@ -1,5 +1,5 @@
import io, os, re, fnmatch
-import sys, gtk, pygtk
+import sys, pygtk
import codecs, ConfigParser
from time import localtime, strftime
from subprocess import Popen, PIPE, STDOUT, call
--
1.8.4.2
_______________________________________________
tuna-devel mailing list
tuna-devel at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
Petr Oros
2013-12-03 12:44:18 UTC
Permalink
Tuna showing traceback when user haven't set DISPLAY variable and using CLI with param -l.
This is caused by gtk library which try create "window", but in CLI mode is not neccesary.
Patch remove unnecesary library which cause this problem

Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuna/config.py b/tuna/config.py
index e446447..77cc4d8 100644
--- a/tuna/config.py
+++ b/tuna/config.py
@@ -1,5 +1,5 @@
import io, os, re, fnmatch
-import sys, gtk, pygtk
+import sys, pygtk
import codecs, ConfigParser
from time import localtime, strftime
from subprocess import Popen, PIPE, STDOUT, call
--
1.8.4.2
Petr Oros
2013-12-03 12:44:19 UTC
Permalink
Tuna throwing value error when not specified priority.
Example: tuna -t PID_OF_SOME_PROCESS -p OTHER
Here "other" not priority, but scheduler policy. OTHER, BATCH and IDLE work
with dynamic priority and entering number is nonsense. After patch apply, tuna use
first part of string as policy and remaining part as priority. All unacceptable values
cause exception in schedutils library and tuna show error

Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/tuna.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tuna/tuna.py b/tuna/tuna.py
index 6dfe740..4e7a0f2 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -490,10 +490,14 @@ def thread_set_priority(tid, policy, rtprio):

def threads_set_priority(tids, parm, affect_children = False):
parms = parm.split(":")
+ rtprio = -1
policy = None
- if len(parms) != 1:
+ if parms[0].upper() in ["OTHER", "BATCH", "IDLE", "FIFO", "RR", "IDLE", "RESET_ON_FORK"]:
policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
- rtprio = int(parms[1])
+ if len(parms) > 1:
+ rtprio = int(parms[1])
+ else:
+ rtprio = 0
else:
rtprio = int(parms[0])
--
1.8.4.2
Petr Oros
2013-12-03 14:35:06 UTC
Permalink
Tuna throwing value error when not specified priority.
Example: tuna -t PID_OF_SOME_PROCESS -p OTHER
Here "other" not priority, but scheduler policy. OTHER, BATCH and IDLE work
with dynamic priority and entering number is nonsense. After patch apply, tuna use
first part of string as policy and remaining part as priority. All unacceptable values
cause exception in schedutils library and tuna show error

Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/tuna.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tuna/tuna.py b/tuna/tuna.py
index 6dfe740..4e7a0f2 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -490,10 +490,14 @@ def thread_set_priority(tid, policy, rtprio):

def threads_set_priority(tids, parm, affect_children = False):
parms = parm.split(":")
+ rtprio = -1
policy = None
- if len(parms) != 1:
+ if parms[0].upper() in ["OTHER", "BATCH", "IDLE", "FIFO", "RR", "IDLE", "RESET_ON_FORK"]:
policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
- rtprio = int(parms[1])
+ if len(parms) > 1:
+ rtprio = int(parms[1])
+ else:
+ rtprio = 0
else:
rtprio = int(parms[0])
--
1.8.4.2
Petr Oros
2013-12-03 14:35:05 UTC
Permalink
Tuna showing traceback when user haven't set DISPLAY variable and using CLI with param -l.
This is caused by gtk library which try create "window", but in CLI mode is not neccesary.
Patch remove unnecesary library which cause this problem

Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuna/config.py b/tuna/config.py
index e446447..77cc4d8 100644
--- a/tuna/config.py
+++ b/tuna/config.py
@@ -1,5 +1,5 @@
import io, os, re, fnmatch
-import sys, gtk, pygtk
+import sys, pygtk
import codecs, ConfigParser
from time import localtime, strftime
from subprocess import Popen, PIPE, STDOUT, call
--
1.8.4.2
Jiri Kastner
2013-12-03 15:47:38 UTC
Permalink
looks ok

[root at localhost site-packages]# patch -p1 < ~/tuna-0001.patch
patching file tuna/config.py
[root at localhost site-packages]# tuna -l
Preloaded config files:
example.conf
[root at localhost site-packages]# cat /etc/fedora-release
Fedora release 21 (Rawhide)
[root at localhost site-packages]#

in i didn't detected any problem.

j.
Post by Petr Oros
Tuna showing traceback when user haven't set DISPLAY variable and using CLI with param -l.
This is caused by gtk library which try create "window", but in CLI mode is not neccesary.
Patch remove unnecesary library which cause this problem
Signed-off-by: Petr Oros <poros at redhat.com>
---
tuna/config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tuna/config.py b/tuna/config.py
index e446447..77cc4d8 100644
--- a/tuna/config.py
+++ b/tuna/config.py
@@ -1,5 +1,5 @@
import io, os, re, fnmatch
-import sys, gtk, pygtk
+import sys, pygtk
import codecs, ConfigParser
from time import localtime, strftime
from subprocess import Popen, PIPE, STDOUT, call
--
1.8.4.2
_______________________________________________
tuna-devel mailing list
tuna-devel at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/tuna-devel/attachments/20131203/4e0db9de/attachment.sig>
Loading...