Module: check_mk
Branch: master
Commit: 31711bc76776ef93b38b0460dd2df249cab9bdcb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=31711bc76776ef…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 16 17:03:40 2019 +0200
typing would have prevented the latest refactoring issue :)
Change-Id: Ia63be64228d5a8fb6ff521486f0511480d028899
---
cmk_base/config.py | 2 ++
cmk_base/core_config.py | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index 42f7db2..08a44f7 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -2857,6 +2857,7 @@ class ConfigCache(object):
self._host_configs = {}
def get_host_config(self, hostname):
+ # type: (str) -> HostConfig
"""Returns a HostConfig instance for the given host
It lazy initializes the host config object and caches the objects during the
livetime
@@ -3411,6 +3412,7 @@ class ConfigCache(object):
def get_config_cache():
+ # type: () -> ConfigCache
config_cache = cmk_base.config_cache.get_dict("config_cache")
if not config_cache:
config_cache["cache"] = ConfigCache()
diff --git a/cmk_base/core_config.py b/cmk_base/core_config.py
index be57b96..16c679e 100644
--- a/cmk_base/core_config.py
+++ b/cmk_base/core_config.py
@@ -29,7 +29,7 @@ import numbers
import os
import sys
import itertools
-from typing import Any, List, Dict # pylint: disable=unused-import
+from typing import Optional, Any, List, Dict # pylint: disable=unused-import
import cmk.utils.paths
import cmk.utils.tty as tty
@@ -547,6 +547,7 @@ def _verify_cluster_address_family(config_cache, host_config):
def _ip_address_of(hostname, family=None):
+ # type: (str, Optional[int]) -> Optional[str]
try:
return ip_lookup.lookup_ip_address(hostname, family)
except Exception as e: