mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 03:53:22 -04:00
44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
From 67b58a3e453d6a7b9c225c1f210e20fe2605908a Mon Sep 17 00:00:00 2001
|
|
From: Florian Schmaus <flo@geekplace.eu>
|
|
Date: Mon, 3 May 2021 19:34:41 +0200
|
|
Subject: [PATCH] Key for key in dool_disk_avgqu.py to avoid KeyError
|
|
|
|
Running "make test" may fail with:
|
|
|
|
Traceback (most recent call last):
|
|
File "./dool", line 2899, in <module>
|
|
main()
|
|
File "./dool", line 2751, in main
|
|
scheduler.run()
|
|
File "/usr/lib/python3.7/sched.py", line 151, in run
|
|
action(*argument, **kwargs)
|
|
File "./dool", line 2847, in perform
|
|
o.extract()
|
|
File "<string>", line 63, in extract
|
|
KeyError: 'rq_ticks'
|
|
make: *** [Makefile:38: test] Error 1
|
|
|
|
See https://bugs.gentoo.org/784704
|
|
---
|
|
plugins/dool_disk_avgqu.py | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/plugins/dool_disk_avgqu.py b/plugins/dool_disk_avgqu.py
|
|
index 5da8d4666d5c..bc421a82028a 100644
|
|
--- a/plugins/dool_disk_avgqu.py
|
|
+++ b/plugins/dool_disk_avgqu.py
|
|
@@ -60,6 +60,10 @@ class dstat_plugin(dstat):
|
|
)
|
|
|
|
for name in self.vars:
|
|
+ # Avoid KeyError: 'rq_ticks'
|
|
+ # See https://bugs.gentoo.org/784704
|
|
+ if 'rq_ticks' not in self.set1[name] or 'rq_ticks' not in self.set2[name]:
|
|
+ continue
|
|
self.val[name] = ( ( self.set2[name]['rq_ticks'] - self.set1[name]['rq_ticks'] ) * 1.0 / elapsed / 1000, )
|
|
|
|
if step == op.delay:
|
|
--
|
|
2.30.2
|
|
|