Skip to content

Commit

Permalink
chore: fix mypy type issue
Browse files Browse the repository at this point in the history
Signed-off-by: Fritz Lehnert <Fritz.Lehnert@tngtech.com>
  • Loading branch information
Neudrino committed Mar 11, 2022
1 parent e0da240 commit 11e5526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lte/gateway/python/magma/kernsnoopd/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from functools import lru_cache
from socket import AF_INET, AF_INET6, inet_ntop
from struct import pack
from typing import Tuple

import psutil
from magma.kernsnoopd import metrics
Expand Down Expand Up @@ -92,7 +93,7 @@ def _get_cmdline(self, pid: int) -> list:
return psutil.Process(pid=pid).cmdline()

@lru_cache(maxsize=1024)
def _ip_addr_to_str(self, family: int, daddr: (int, int)) -> str:
def _ip_addr_to_str(self, family: int, daddr: Tuple[int, int]) -> str: # type: ignore[return]
"""
_ip_addr_to_str returns a string representation of an IPv4 or IPv6
address. It caches results in an LRU cache to reduce cost of conversion
Expand Down
3 changes: 2 additions & 1 deletion lte/gateway/python/magma/kernsnoopd/snooper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""
import logging
import os
from typing import Any, List

from bcc import BPF # pylint:disable=import-error
from jinja2 import Template
Expand Down Expand Up @@ -65,7 +66,7 @@ def __init__(

super().__init__(interval=collect_interval, loop=service_loop)
self._bpf = None
self._handlers = []
self._handlers: List[Any] = []
self._loop = service_loop
self._ebpf_programs = programs
self._service_registry = service_registry
Expand Down

0 comments on commit 11e5526

Please sign in to comment.