diff --git a/linspector/services/misc/dummy.py b/linspector/services/misc/dummy.py index 4d1fefd..c235e67 100644 --- a/linspector/services/misc/dummy.py +++ b/linspector/services/misc/dummy.py @@ -11,6 +11,10 @@ def create(configuration, environment, log): class DummyService(Service): + """ + This is a dummy service which is doing nothing but logging. It will be used if some other + service fails at load / configuration, or it can be used for testing. + """ def __init__(self, configuration, environment, log): super().__init__(configuration, environment, log) self.__configuration = configuration diff --git a/linspector/services/misc/random.py b/linspector/services/misc/random.py index 9c158dc..50410ed 100644 --- a/linspector/services/misc/random.py +++ b/linspector/services/misc/random.py @@ -14,6 +14,9 @@ def create(configuration, environment, log): class DummyService(Service): + """ + This is a service that produces random data and status results. It is only used for testing. + """ def __init__(self, configuration, environment, log): super().__init__(configuration, environment, log) self.__configuration = configuration @@ -21,7 +24,7 @@ class DummyService(Service): self.__log = log def execute(self, identifier, monitor, service, **kwargs): - result = random.randint(0, 1) + status = random.randint(0, 1) rnd1 = random.randint(0, 99999999999999) rnd2 = random.randint(0, 99999999999999) rnd3 = random.randint(0, 99999999999999) @@ -39,6 +42,6 @@ class DummyService(Service): self.__log.info('identifier=' + identifier + ' host=' + monitor.get_host() + ' service=' + service + - ' status=' + ('OK' if result == 0 else 'ERROR') + ' sha512=' + + ' status=' + ('OK' if status == 0 else 'ERROR') + ' sha512=' + sha512_2) return True