Module: check_mk
Branch: master
Commit: aace6e6c257257468452ed4a2e932e9551f5324e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aace6e6c257257…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 1 16:10:19 2018 +0200
Mark abstract methods with abc module
Change-Id: I86a4e5362c144942f9f33726bc9bae6f5d81e9c3
---
cmk/ec/main.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 4ccc40b..3fd027a 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -31,6 +31,7 @@
# creating objects. Or at least update the documentation. It is not clear
# which fields are mandatory for the events.
+import abc
import ast
import errno
import json
@@ -201,6 +202,10 @@ class ECLock(object):
class ECServerThread(threading.Thread):
+ @abc.abstractmethod
+ def serve(self):
+ raise NotImplementedError()
+
def __init__(self, name, logger, settings, config, slave_status, profiling_enabled,
profile_file):
super(ECServerThread, self).__init__(name=name)
self.settings = settings
@@ -233,9 +238,6 @@ class ECServerThread(threading.Thread):
def terminate(self):
self._terminate_event.set()
- def serve(self):
- raise NotImplementedError()
-
def terminate(terminate_main_event, event_server, status_server):
terminate_main_event.set()
@@ -2645,6 +2647,12 @@ class StatusTable(object):
prefix = None
columns = []
+ # Must return a enumerable type containing fully populated lists (rows) matching the
+ # columns of the table
+ @abc.abstractmethod
+ def _enumerate(self, query):
+ raise NotImplementedError()
+
def __init__(self, logger):
super(StatusTable, self).__init__()
self._logger = logger.getChild("status_table.%s" % self.prefix)
@@ -2684,11 +2692,6 @@ class StatusTable(object):
yield self._build_result_row(row, requested_column_indexes)
num_rows += 1
- # Must return a enumerable type containing fully populated lists (rows) matching the
- # columns of the table
- def _enumerate(self, query):
- raise NotImplementedError()
-
def _build_result_row(self, row, requested_column_indexes):
result_row = []
for index in requested_column_indexes: