Module: check_mk
Branch: master
Commit: 196c6daa2f022bcdf4208b52067b133c009917c7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=196c6daa2f022b…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Jul 16 16:20:31 2018 +0200
Partial revert to get background jobs working again. Ugly as hell...
Change-Id: Ie8d5ea35100729067db6822fb1ef0e3e2752473e
---
cmk/gui/gui_background_job.py | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/gui_background_job.py b/cmk/gui/gui_background_job.py
index 8f2b93b..0069151 100644
--- a/cmk/gui/gui_background_job.py
+++ b/cmk/gui/gui_background_job.py
@@ -150,6 +150,24 @@ class
GUIBackgroundJobSnapshottedFunctions(background_job.BackgroundJob):
return self.get_status().get("user") != config.user.id
+ # FIXME: There is some arcane metaprogramming Kung Fu going on in
+ # GUIBackgroundStatusSnapshot which needs the methods *in this class*,
+ # although they are actually totally useless here.
+ def is_running(self): # pylint: disable=useless-super-delegation
+ return super(GUIBackgroundJobSnapshottedFunctions, self).is_running()
+
+
+ def exists(self): # pylint: disable=useless-super-delegation
+ return super(GUIBackgroundJobSnapshottedFunctions, self).exists()
+
+
+ def get_job_id(self): # pylint: disable=useless-super-delegation
+ return super(GUIBackgroundJobSnapshottedFunctions, self).get_job_id()
+
+
+ def get_title(self): # pylint: disable=useless-super-delegation
+ return super(GUIBackgroundJobSnapshottedFunctions, self).get_title()
+
# TODO: The superclasses are nonsense: GUIBackgroundJobSnapshottedFunctions
# already derives from background_jobs.BackgroundJob. What is the right way to
@@ -205,8 +223,8 @@ class GUIBackgroundStatusSnapshot(object):
self._job_status = background_job.get_status()
self._logger = background_job._logger.getChild("snapshot")
- for name in dir(GUIBackgroundJobSnapshottedFunctions):
- if callable(getattr(GUIBackgroundJobSnapshottedFunctions, name)):
+ for name, value in GUIBackgroundJobSnapshottedFunctions.__dict__.iteritems():
+ if hasattr(value, "__call__"):
self._job_status[name] = getattr(background_job, name)()