Skip to content
Permalink
Browse files

Increase mypy scope a in cmk_base code

Change-Id: I4e3c37ae38cd272fcbb8234d85339a8efc770e29
  • Loading branch information...
LarsMichelsen committed Apr 17, 2019
1 parent 8274da5 commit 7dfb9419c80f7476a3750b42fd81f518c1410ab0
Showing with 30 additions and 2 deletions.
  1. +1 −1 cmk_base/data_sources/__init__.py
  2. +7 −1 cmk_base/snmp_utils.py
  3. +18 −0 mypy.ini
  4. +4 −0 tests/static/Makefile
@@ -65,7 +65,7 @@
try:
import cmk_base.cee.keepalive as keepalive
except Exception:
keepalive = None
keepalive = None # type: ignore


def _in_keepalive_mode():
@@ -74,7 +74,13 @@ def is_snmpv3_host(host_config):
# And if it is a six-tuple, it has the following additional arguments:
# (5) privacy protocol (DES|AES) (-x)
# (6) privacy protocol pass phrase (-X)
SNMPCredentials = Union[str, Tuple[str, str, str, str], Tuple[str, str, str, str], Tuple[str, str]]
SNMPCommunity = str
# TODO: This does not work as intended
#SNMPv3NoAuthNoPriv = Tuple[str, str]
#SNMPv3AuthNoPriv = Tuple[str, str, str, str]
#SNMPv3AuthPriv = Tuple[str, str, str, str, str, str]
#SNMPCredentials = Union[SNMPCommunity, SNMPv3NoAuthNoPriv, SNMPv3AuthNoPriv, SNMPv3AuthPriv]
SNMPCredentials = Union[SNMPCommunity, Tuple[str, ...]]

# Wraps the configuration of a host into a single object for the SNMP code
SNMPHostConfig = NamedTuple(
@@ -2,3 +2,21 @@
python_version = 2.7
strict_optional = True
follow_imports = silent

# Used by cmk_base/data_sources/impi.py - not able to make this visible easily
# Disabling checking this external module for the moment to be able to enable
# checking our code.
[mypy-pyghmi.*]
ignore_missing_imports = True

# Used by cmk_base/data_sources/tcp.py. Same as above.
[mypy-Cryptodome.*]
ignore_missing_imports = True

# Used by cmk_base/cee/rrd.py. Same as above
[mypy-rrdtool.*]
ignore_missing_imports = True

# Used by cmk_base/cee/inline_snmp.py. Same as above
[mypy-netsnmp.*]
ignore_missing_imports = True
@@ -6,6 +6,10 @@ FILES_TO_CHECK := $(realpath $(addprefix ../../cmk/ec/,defaults.py export.py mai
$(realpath $(wildcard ../../cmk/notification_plugins/*.py)) \
$(realpath $(wildcard ../../cmk/special_agents/*.py)) \
$(realpath $(wildcard ../../cmk_base/*.py)) \
$(wildcard $(realpath ../..)/cmk_base/cee/*.py) \
$(wildcard $(realpath ../..)/cmk_base/automations/*.py) \
$(wildcard $(realpath ../..)/cmk_base/modes/*.py) \
$(wildcard $(realpath ../..)/cmk_base/data_sources/*.py) \
$(realpath $(addprefix ../../cmk/gui/,dashboard.py exceptions.py globals.py htmllib.py \
i18n.py sidebar.py sites.py table.py visuals.py permissions.py)) \
$(realpath $(addprefix ../../cmk/gui/watolib/,rulespecs.py)) \

0 comments on commit 7dfb941

Please sign in to comment.
You can’t perform that action at this time.