John Kacur
2016-05-30 11:27:03 UTC
sysfy.py inserts None for offline cpus in class cpus, method reload, via
class cpu method reload.
This is potentially useful, so we don't want to change these classes.
However in cpuview.py - class cpuview, we don't want to display these
offline cpus, so we only need to recognize that the type None can be
returned and then skip over it.
This fixes Bugzilla 1036156
First detected on some ppc
./tuna-cmd.py
Traceback (most recent call last):
File "./tuna-cmd.py", line 656, in <module>
main()
File "./tuna-cmd.py", line 650, in main
app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)
File "/home/jkacur/tuna/tuna/tuna_gui.py", line 49, in __init__
self.procview, self.irqview, cpus_filtered)
File "/home/jkacur/tuna/tuna/gui/cpuview.py", line 253, in __init__
socket_ids = [ int(id) for id in self.cpus.sockets.keys() ]
Signed-off-by: John Kacur <***@redhat.com>
---
tuna/gui/cpuview.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tuna/gui/cpuview.py b/tuna/gui/cpuview.py
index 41a3d9bbbfc3..c84ecd739c70 100755
--- a/tuna/gui/cpuview.py
+++ b/tuna/gui/cpuview.py
@@ -250,7 +250,12 @@ class cpuview:
self.irqview = irqview
vbox = window.get_child().get_child()
- socket_ids = [ int(id) for id in self.cpus.sockets.keys() ]
+ socket_ids = []
+ for id in self.cpus.sockets.keys():
+ try:
+ socket_ids.append(int(id))
+ except TypeError: # Skip over offline cpus - type None
+ continue
socket_ids.sort()
self.nr_sockets = len(socket_ids)
class cpu method reload.
This is potentially useful, so we don't want to change these classes.
However in cpuview.py - class cpuview, we don't want to display these
offline cpus, so we only need to recognize that the type None can be
returned and then skip over it.
This fixes Bugzilla 1036156
First detected on some ppc
./tuna-cmd.py
Traceback (most recent call last):
File "./tuna-cmd.py", line 656, in <module>
main()
File "./tuna-cmd.py", line 650, in main
app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)
File "/home/jkacur/tuna/tuna/tuna_gui.py", line 49, in __init__
self.procview, self.irqview, cpus_filtered)
File "/home/jkacur/tuna/tuna/gui/cpuview.py", line 253, in __init__
socket_ids = [ int(id) for id in self.cpus.sockets.keys() ]
Signed-off-by: John Kacur <***@redhat.com>
---
tuna/gui/cpuview.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tuna/gui/cpuview.py b/tuna/gui/cpuview.py
index 41a3d9bbbfc3..c84ecd739c70 100755
--- a/tuna/gui/cpuview.py
+++ b/tuna/gui/cpuview.py
@@ -250,7 +250,12 @@ class cpuview:
self.irqview = irqview
vbox = window.get_child().get_child()
- socket_ids = [ int(id) for id in self.cpus.sockets.keys() ]
+ socket_ids = []
+ for id in self.cpus.sockets.keys():
+ try:
+ socket_ids.append(int(id))
+ except TypeError: # Skip over offline cpus - type None
+ continue
socket_ids.sort()
self.nr_sockets = len(socket_ids)
--
2.4.11
2.4.11