diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors index f2ef24fd2c..1154889a9d 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors @@ -13,16 +13,17 @@ from __future__ import print_function import os import time -RESULTS_DIR = "/home/zulip/mirror_status" +RESULTS_DIR = "/home/zulip/mirror_status" # type: str states = { "OK": 0, "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3 - } + } # type: Dict[str, int] def report(state, output): + # type: (str, str) -> None print("%s\n%s" % (state, output)) exit(states[state]) diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness index 6972496107..36a1d55396 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness @@ -27,14 +27,18 @@ django.setup() from zerver.models import UserActivity +if False: + from typing import Any + states = { "OK": 0, "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3 - } + } # type: Dict[str, int] def report(state, short_msg, too_old=None): + # type: (str, str, Set[Any]) -> None too_old_data = "" if too_old: too_old_data = "\nLast call to get_message for recently out of date mirrors:\n" + "\n".join( diff --git a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror index 268acbe891..8e7cdfbd9f 100755 --- a/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror +++ b/puppet/zulip_ops/files/nagios_plugins/zulip_zephyr_mirror/check_zephyr_mirror @@ -20,9 +20,10 @@ states = { "WARNING": 1, "CRITICAL": 2, "UNKNOWN": 3 - } + } # type: Dict[str, int] def report(state, data, last_check): + # type: (str, str, float) -> None print("%s: Last test run completed at %s\n%s" % ( state, time.strftime("%Y-%m-%d %H:%M %Z", time.gmtime(last_check)), data)) diff --git a/puppet/zulip_ops/files/zulip-ec2-configure-interfaces b/puppet/zulip_ops/files/zulip-ec2-configure-interfaces index f10b253e20..e7eaded5a4 100755 --- a/puppet/zulip_ops/files/zulip-ec2-configure-interfaces +++ b/puppet/zulip_ops/files/zulip-ec2-configure-interfaces @@ -54,14 +54,18 @@ import sys import boto.utils import netifaces from six.moves import range +if False: + from typing import Optional def address_of(device_id): + # type: (int) -> Optional[str] try: return netifaces.ifaddresses("ens%i" % device_id)[netifaces.AF_INET][0]['addr'] except KeyError: return None def guess_gateway(device_id): + # type: (int) -> str # This will not work if the default gateway isn't n.n.n.1. address = address_of(device_id).split('.') address[3] = '1' diff --git a/tools/run-mypy b/tools/run-mypy index 1694e0ec54..e100eda528 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -40,7 +40,6 @@ api/zulip/__init__.py bots/githook-post-receive bots/jabber_mirror_backend.py bots/zephyr_mirror_backend.py -puppet/zulip_ops tools/deprecated/inject-messages/inject-messages zproject/settings.py zproject/test_settings.py