Module: check_mk
Branch: master
Commit: 80cf7e23f738ca2d15ccc5898d2b0fa2d5f8e815
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=80cf7e23f738ca…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jul 16 09:29:40 2018 +0200
Attempted fix/workaround for background job problem (untested).
Change-Id: I6476258791b95ca373b968724a97e9c478d87fe5
---
cmk/gui/gui_background_job.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/gui_background_job.py b/cmk/gui/gui_background_job.py
index 12b8534..c4b2e12 100644
--- a/cmk/gui/gui_background_job.py
+++ b/cmk/gui/gui_background_job.py
@@ -150,6 +150,9 @@ class
GUIBackgroundJobSnapshottedFunctions(background_job.BackgroundJob):
+# TODO: The superclasses are nonsense: GUIBackgroundJobSnapshottedFunctions
+# already derives from background_jobs.BackgroundJob. What is the right way to
+# fix this?
class GUIBackgroundJob(GUIBackgroundJobSnapshottedFunctions,
background_job.BackgroundJob):
_background_process_class = GUIBackgroundProcess
@@ -193,14 +196,16 @@ class GUIBackgroundJob(GUIBackgroundJobSnapshottedFunctions,
background_job.Back
# Provides the frozen state of a background job
# Quite helpful when generating GUI pages with several phases
+
+# TODO: What on earth is this class supposed to do?
class GUIBackgroundStatusSnapshot(object):
def __init__(self, background_job):
super(GUIBackgroundStatusSnapshot, self).__init__()
self._job_status = background_job.get_status()
self._logger = background_job._logger.getChild("snapshot")
- for name, value in GUIBackgroundJobSnapshottedFunctions.__dict__.iteritems():
- if hasattr(value, "__call__"):
+ for name in dir(GUIBackgroundJobSnapshottedFunctions):
+ if callable(getattr(GUIBackgroundJobSnapshottedFunctions, name)):
self._job_status[name] = getattr(background_job, name)()