From c042ff47bb7118998502243e0663d310f899a0d9 Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Wed, 29 Jul 2026 17:59:15 +0200 Subject: [PATCH 1/4] maybestuff --- pyproject.toml | 16 + src/drunc/controller/interface/commands.py | 4 +- src/drunc/controller/interface/context.py | 18 +- src/drunc/controller/interface/shell_utils.py | 84 +- .../process_manager/interface/context.py | 12 +- .../interface/process_manager.py | 28 +- src/drunc/unified_shell/commands.py | 56 +- src/drunc/unified_shell/context.py | 32 +- src/drunc/unified_shell/mypy_out.md | 811 ++++++++++++++++++ src/drunc/unified_shell/shell.py | 62 +- src/drunc/unified_shell/shell_utils.py | 130 +-- src/drunc/utils/shell_utils.py | 88 +- 12 files changed, 1173 insertions(+), 168 deletions(-) create mode 100644 src/drunc/unified_shell/mypy_out.md diff --git a/pyproject.toml b/pyproject.toml index 97f26b32f..cfb9c327f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,8 +75,12 @@ source = ["drunc"] [tool.ruff.lint] ignore = [ "E501", # Don't enforce line lengths within a linting context + "D201", + "D202", + "D212" ] select = [ + "D", "E", # pycodestyle errors "F", # check for errors using PyFlakes "I", # best practices for import calls @@ -113,3 +117,15 @@ module = ["google.rpc.*"] [[tool.mypy.overrides]] ignore_missing_imports = true module = ["conffwk"] + +[[tool.mypy.overrides]] +ignore_missing_imports = true +module = [ + "click_shell", + "confmodel_dal", + "flask_restful", + "grpc_status", + "kafkaopmon.*", + "opmonlib.*", + "socks", +] diff --git a/src/drunc/controller/interface/commands.py b/src/drunc/controller/interface/commands.py index 26f60972b..b50b866d0 100644 --- a/src/drunc/controller/interface/commands.py +++ b/src/drunc/controller/interface/commands.py @@ -151,7 +151,7 @@ def connect(obj: ControllerContext, controller_address: str, force: bool) -> Non @click.command("disconnect") @click.option("-f", "--force", is_flag=True, help="Confirm the disconnect") @click.pass_obj -def disconnect(obj: ControllerContext, force: bool): +def disconnect(obj: ControllerContext, force: bool) -> None: if not obj.has_driver("controller"): log.info("You are not connected to any controller.") return @@ -251,7 +251,7 @@ def who_am_i(obj: ControllerContext) -> None: @click.command("echo") @click.argument("text", required=False) @click.pass_obj -def echo(obj, text: str | None) -> None: +def echo(obj: ControllerContext, text: str | None) -> None: log_echo.info(text or "") diff --git a/src/drunc/controller/interface/context.py b/src/drunc/controller/interface/context.py index 3468edce6..c3bbc7225 100644 --- a/src/drunc/controller/interface/context.py +++ b/src/drunc/controller/interface/context.py @@ -1,4 +1,4 @@ -from collections.abc import Mapping +from collections.abc import MutableMapping from druncschema.token_pb2 import Token @@ -13,18 +13,22 @@ class ControllerContext(ShellContext): # boilerplatefest shell_id = "controller_shell" - def __init__(self): + def __init__(self) -> None: self.status_receiver = None self.took_control = False super(ControllerContext, self).__init__() - def reset(self, address: str = None): + def reset(self, *args: object, **kwargs: object) -> None: + address_raw = kwargs.get("address") + if address_raw is None and args: + address_raw = args[0] + address = str(address_raw) if address_raw is not None else "" self.address = resolve_localhost_to_hostname(address) super(ControllerContext, self)._reset( name="controller_context", token_args={}, driver_args={} ) - def create_drivers(self, **kwargs) -> Mapping[str, object]: + def create_drivers(self, **kwargs: object) -> MutableMapping[str, object]: if not self.address: return {} return {"controller": ControllerDriver(self.address, self._token)} @@ -32,6 +36,10 @@ def create_drivers(self, **kwargs) -> Mapping[str, object]: def create_token(self, **kwargs) -> Token: return create_dummy_token_from_uname() - def terminate(self): + def set_controller_driver(self, address_controller: str) -> None: + self.address = resolve_localhost_to_hostname(address_controller) + self._drivers["controller"] = ControllerDriver(self.address, self._token) + + def terminate(self) -> None: if self.status_receiver: self.status_receiver.stop() diff --git a/src/drunc/controller/interface/shell_utils.py b/src/drunc/controller/interface/shell_utils.py index ec5529baa..e855ef1c4 100644 --- a/src/drunc/controller/interface/shell_utils.py +++ b/src/drunc/controller/interface/shell_utils.py @@ -9,6 +9,7 @@ from collections.abc import Sequence from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass +from typing import Protocol, TypeAlias from urllib.parse import urlparse import click @@ -58,6 +59,13 @@ class StatusDescriptionPair: description: DescribeResponse | None = None +class FSMExecutionResponseLike(Protocol): + name: str + flag: int + fsm_flag: int + children: Sequence["FSMExecutionResponseLike"] + + def match_children( statuses: Sequence[StatusResponse], descriptions: Sequence[DescribeResponse] ) -> dict[str, StatusDescriptionPair]: @@ -76,7 +84,7 @@ def get_status_table( describe_response: DescribeResponse, display_host_overrides: dict[str, str] | None = None, show_ip_address: bool = False, -): +) -> Table | Group: status = status_response.status description = describe_response.description @@ -102,7 +110,7 @@ def add_status_to_table( status_response: StatusResponse, describe_response: DescribeResponse, prefix: str, - ): + ) -> None: status = status_response.status description = describe_response.description if status is None or description is None: @@ -183,7 +191,7 @@ def make_uri(host: str) -> str: add_status_to_table(t, status_response, describe_response, "") - def add_runinfo_to_table(table: Table, status: Status): + def add_runinfo_to_table(table: Table, status: Status) -> None: table.add_row("Run number", str(status.run_info.run_number)) table.add_row("Run type", status.run_info.run_type) table.add_row( @@ -217,12 +225,12 @@ def add_runinfo_to_table(table: Table, status: Status): def render_status_table( - ctx: ControllerContext, + ctx: ControllerContext | UnifiedShellContext, target: str = "", execute_along_path: bool = True, execute_on_all_subsequent_children_in_path: bool = True, show_ip_address: bool = False, -): +) -> Table | Group: statuses = ctx.get_driver("controller").status( target=target, execute_along_path=execute_along_path, @@ -243,7 +251,13 @@ def render_status_table( class StatusTableUpdater(Progress): - def __init__(self, ctx, refresh_per_second=2, *args, **kwargs) -> None: + def __init__( + self, + ctx: ControllerContext | UnifiedShellContext, + refresh_per_second: float = 2, + *args: object, + **kwargs: object, + ) -> None: self.ctx = ctx self.update_table() @@ -256,7 +270,7 @@ def __init__(self, ctx, refresh_per_second=2, *args, **kwargs) -> None: super().__init__(*args, refresh_per_second=refresh_per_second, **kwargs) - def update_table(self): + def update_table(self) -> None: self.table = render_status_table(self.ctx) def get_renderable(self) -> ConsoleRenderable | RichCast | str: @@ -264,8 +278,10 @@ def get_renderable(self) -> ConsoleRenderable | RichCast | str: return renderable -def controller_cleanup_wrapper(ctx): - def controller_cleanup(): +def controller_cleanup_wrapper( + ctx: ControllerContext | UnifiedShellContext, +): + def controller_cleanup() -> None: log = logging.getLogger("controller.shell_utils") dead = False who = "" @@ -296,7 +312,9 @@ def controller_cleanup(): return controller_cleanup -def controller_setup(ctx, controller_address): +def controller_setup( + ctx: ControllerContext | UnifiedShellContext, controller_address: str +) -> Description: log = logging.getLogger("controller.shell_utils") if not hasattr(ctx, "took_control"): raise DruncSetupException( @@ -389,7 +407,9 @@ def controller_setup(ctx, controller_address): return desc -def search_fsm_command(command_name: str, command_list: list[FSMCommand]): +def search_fsm_command( + command_name: str, command_list: list[FSMCommand] +) -> FSMCommand | None: for command in command_list: if command_name == command.name: return command @@ -432,13 +452,17 @@ def __init__(self, arguments_and_values): super(UnhandledArguments, self).__init__(message) -def format_bool(b, format=["dark_green", "red"], false_is_good=False): +def format_bool( + b: bool, + format: Sequence[str] = ("dark_green", "red"), + false_is_good: bool = False, +) -> str: index_true = 0 if not false_is_good else 1 index_false = 1 if not false_is_good else 0 return f"[{format[index_true]}]Yes[/]" if b else f"[{format[index_false]}]No[/]" -def tree_prefix(i, n): +def tree_prefix(i: int, n: int) -> str: first_one = "└── " first_many = "├── " next = "├── " @@ -456,7 +480,7 @@ def tree_prefix(i, n): def validate_and_format_fsm_arguments( arguments: dict[str, int | bool | str | float | None] | None, command_arguments: list[Argument], -) -> dict[str, int | bool | str | float | None]: +) -> dict[str, any_pb2.Any]: """ Validates and formats the arguments passed to an FSM command based on the command's argument descriptions. @@ -477,7 +501,7 @@ def validate_and_format_fsm_arguments( # Define the output dict that will be sent to the controller, with argument names # and their formatted values - out_dict: dict[str, any_pb2] = {} + out_dict: dict[str, any_pb2.Any] = {} # Strip out any arguments that are None, as they are considered not passed, and will # be set to default values if they exist, or raise an error if they are mandatory @@ -491,7 +515,6 @@ def validate_and_format_fsm_arguments( for argument_desc in command_arguments: #  type: Argument aname: str = argument_desc.name atype: str = Argument.Type.Name(argument_desc.type) - adefa: str | int | float | bool | None = argument_desc.default_value # Check for duplicate arguments if aname in out_dict: @@ -507,7 +530,8 @@ def validate_and_format_fsm_arguments( # If the argument is not passed, and it has a default value, use the default value value: str | int | float | bool | None = arguments.get(aname) if value is None: - out_dict[aname] = adefa + if argument_desc.HasField("default_value"): + out_dict[aname] = argument_desc.default_value continue # Convert the argument value to the appropriate type based on the argument @@ -544,7 +568,9 @@ def validate_and_format_fsm_arguments( return out_dict -def collect_not_ready(response, found=None): +def collect_not_ready( + response: StatusResponse, found: list[str] | None = None +) -> list[str]: if found is None: found = [] @@ -627,7 +653,7 @@ def run_one_fsm_command( else: class DummyCommand: - pass + arguments: list[Argument] command_desc = DummyCommand() command_desc.arguments = [] @@ -708,7 +734,9 @@ class DummyCommand: t.add_column("Command execution") t.add_column("FSM transition") - def bool_to_success(flag_message, message_type): + def bool_to_success( + flag_message: int, message_type: type[ResponseFlag] | type[FSMResponseFlag] + ) -> str: flag = message_type.Name(flag_message).replace("_", " ").title() success = False @@ -725,7 +753,9 @@ def bool_to_success(flag_message, message_type): return f"[dark_green]{flag}[/]" if success else f"[red]{flag}[/]" - def add_to_table(table, response, prefix=""): + def add_to_table( + table: Table, response: FSMExecutionResponseLike, prefix: str = "" + ) -> None: executed_command = response.flag == ResponseFlag.EXECUTED_SUCCESSFULLY table.add_row( @@ -764,7 +794,7 @@ def generate_fsm_command(ctx, transition: FSMCommandDescription, controller_name """ # Construct the partial command executing the defined FSM command with click options - cmd: functools.partial = functools.partial( + cmd = functools.partial( run_one_fsm_command, controller_name=controller_name, transition_name=transition.name, @@ -778,7 +808,8 @@ def generate_fsm_command(ctx, transition: FSMCommandDescription, controller_name )(cmd) # Define the mapping of gRPC argument types to click types - type_map: dict[int, str | int | float | bool] = { + ClickValueType: TypeAlias = type[str] | type[int] | type[float] | type[bool] + type_map: dict[int, ClickValueType] = { Argument.Type.STRING: str, Argument.Type.INT: int, Argument.Type.FLOAT: float, @@ -787,7 +818,10 @@ def generate_fsm_command(ctx, transition: FSMCommandDescription, controller_name # Define the mapping of gRPC argument types to their corresponding protobuf message # types for default value unpacking - msg_map: dict(any_pb2) = { + ProtobufScalarMsgType: TypeAlias = ( + type[string_msg] | type[int_msg] | type[float_msg] | type[bool_msg] + ) + msg_map: dict[ClickValueType, ProtobufScalarMsgType] = { str: string_msg, int: int_msg, float: float_msg, @@ -799,7 +833,7 @@ def generate_fsm_command(ctx, transition: FSMCommandDescription, controller_name for argument in transition.arguments: # type: Argument # Map the gRPC argument type to a click type, raise an exception if the type is # unhandled - atype: Argument.Type.V = type_map.get(argument.type) + atype = type_map.get(argument.type) if not atype: raise Exception(f"Unhandled argument type '{argument.type}'") diff --git a/src/drunc/process_manager/interface/context.py b/src/drunc/process_manager/interface/context.py index 24c0ff9df..d3ada3428 100644 --- a/src/drunc/process_manager/interface/context.py +++ b/src/drunc/process_manager/interface/context.py @@ -13,11 +13,15 @@ class ProcessManagerContext(ShellContext): # boilerplatefest shell_id = "process_manager_shell" - def __init__(self, *args, **kwargs): + def __init__(self, *args: object, **kwargs: object) -> None: self.status_receiver = None super(ProcessManagerContext, self).__init__(*args, **kwargs) - def reset(self, address: str = "", **kwargs): + def reset(self, *args: object, **kwargs: object) -> None: + address_raw = kwargs.get("address") + if address_raw is None and args: + address_raw = args[0] + address = str(address_raw) if address_raw is not None else "" self.address = resolve_localhost_to_hostname(address) super(ProcessManagerContext, self)._reset( name="process_manager_context", @@ -25,7 +29,7 @@ def reset(self, address: str = "", **kwargs): driver_args={}, ) - def create_drivers(self, **kwargs) -> MutableMapping[str, object]: + def create_drivers(self, **kwargs: object) -> MutableMapping[str, object]: if not self.address: return {} return { @@ -38,6 +42,6 @@ def create_drivers(self, **kwargs) -> MutableMapping[str, object]: def create_token(self, **kwargs) -> Token: return create_dummy_token_from_uname() - def terminate(self): + def terminate(self) -> None: if self.status_receiver: self.status_receiver.stop() diff --git a/src/drunc/process_manager/interface/process_manager.py b/src/drunc/process_manager/interface/process_manager.py index eb2fa4e13..79e3008b4 100644 --- a/src/drunc/process_manager/interface/process_manager.py +++ b/src/drunc/process_manager/interface/process_manager.py @@ -4,6 +4,10 @@ import signal import sys import types +from collections.abc import Callable +from multiprocessing.sharedctypes import Synchronized +from multiprocessing.synchronize import Event +from typing import cast import click import grpc @@ -31,7 +35,7 @@ resolve_localhost_and_127_ip_to_network_ip, ) -_cleanup_coroutines = [] +_cleanup_coroutines: list[Callable[[], None]] = [] def run_pm( @@ -39,10 +43,10 @@ def run_pm( pm_address: str, log_level: str, override_logs: bool, - log_path: str = None, - ready_event: bool = None, - signal_handler: bool = None, - generated_port: bool = None, + log_path: str | None = None, + ready_event: Event | None = None, + signal_handler: Callable[[], None] | None = None, + generated_port: Synchronized[int] | None = None, ) -> None: appName = "process_manager" log = get_logger(logger_name=appName, rich_handler=True) @@ -63,16 +67,22 @@ def run_pm( path_or_url = conf_path.split(":")[1] if conf_type == ConfTypes.JsonFileName: - pmch = ProcessManagerConfHandler.from_json(path=path_or_url, log_path=log_path) + pmch = ProcessManagerConfHandler.from_json( + path=path_or_url, + log_path=log_path or "", + ) else: - pmch = ProcessManagerConfHandler.from_pyobject(data=path_or_url) + pmch = cast( + ProcessManagerConfHandler, + ProcessManagerConfHandler.from_pyobject(data=path_or_url), + ) log_path = get_log_path( user=getpass.getuser(), session_name=getattr(pmch, "pm_type", pmch.type).name, application_name=appName, override_logs=override_logs, - app_log_path=log_path, + app_log_path=log_path or "", ) # Logger has been added to process_manager, so everything will be logged @@ -133,7 +143,7 @@ def server_shutdown() -> None: server = None return - def handle_sigterm(signum: int, frame: types.FrameType) -> None: + def handle_sigterm(signum: int, frame: types.FrameType | None) -> None: """ Handle the SIGTERM signal to gracefully shut down the server. diff --git a/src/drunc/unified_shell/commands.py b/src/drunc/unified_shell/commands.py index e41b42a15..2d4a7c884 100644 --- a/src/drunc/unified_shell/commands.py +++ b/src/drunc/unified_shell/commands.py @@ -1,6 +1,7 @@ import getpass import sys from functools import update_wrapper +from typing import Callable, ParamSpec, TypeVar, cast import click from druncschema.process_manager_pb2 import ProcessInstance, ProcessQuery @@ -20,10 +21,13 @@ restart_impl, ) from drunc.process_manager.interface.context import ProcessManagerContext -from drunc.unified_shell.context import UnifiedShellMode +from drunc.unified_shell.context import UnifiedShellContext, UnifiedShellMode from drunc.utils.shell_utils import InterruptedCommand, log_pm_cmd from drunc.utils.utils import get_logger +P = ParamSpec("P") +R = TypeVar("R") + @click.command("boot") @click.option( @@ -46,10 +50,10 @@ ) @click.pass_obj def boot( - obj: ProcessManagerContext, + obj: UnifiedShellContext, override_logs: bool | None, - controller_log_level: bool | None, - sleep_between_app_boot: int | float = 0, + controller_log_level: str | None, + sleep_between_app_boot: float = 0, ) -> None: log = get_logger("unified_shell.boot") log_pm_cmd(obj) @@ -84,8 +88,11 @@ def boot( override_logs=override_logs_boot, sleep_between_app_boot=sleep_between_app_boot, ) - expected_booted_processes = sum(1 for _ in results) + if results is None: + log.error("Boot request did not return any results.") + return for result in results: + expected_booted_processes += 1 log.critical( f"Booting process: {result.values[0].process_description.metadata.name}" ) @@ -149,7 +156,7 @@ def boot( @click.command("terminate") @click.pass_obj @click.pass_context -def terminate(ctx, obj): +def terminate(ctx: click.core.Context, obj: UnifiedShellContext) -> None: """ Execute the process manager terminate command, but only do this for the current session @@ -166,64 +173,71 @@ def terminate(ctx, obj): obj.delete_driver("controller") -def session_injector(f): +def session_injector(f: Callable[P, R]) -> Callable[P, R]: @click.pass_context - def wrapper(ctx, *args, **kwargs): + def wrapper(ctx: click.core.Context, *args: P.args, **kwargs: P.kwargs) -> R: kwargs["session"] = ctx.obj.session_name - return ctx.invoke(f, *args, **kwargs) + return cast(R, ctx.invoke(f, *args, **kwargs)) - return update_wrapper(wrapper, f) + return cast(Callable[P, R], update_wrapper(wrapper, f)) @click.command("ps") @session_injector @add_query_options_no_session(at_least_one=True) @ps_decorators -def ps(obj, query, long_format, width): +def ps( + obj: UnifiedShellContext, query: ProcessQuery, long_format: bool, width: int +) -> None: log_pm_cmd(obj) - return ps_impl(obj, query, long_format, width) + ps_impl(cast(ProcessManagerContext, obj), query, long_format, width) @click.command("logs") @session_injector @add_query_options_no_session(at_least_one=True) @logs_decorators -def logs(obj, how_far, grep, query): +def logs( + obj: UnifiedShellContext, + how_far: int, + grep: str | None, + query: ProcessQuery, +) -> None: log_pm_cmd(obj) - return logs_impl(obj, how_far, grep, query) + logs_impl(cast(ProcessManagerContext, obj), how_far, grep or "", query) @click.command("kill") @session_injector @add_query_options_no_session(at_least_one=True) @kill_decorators -def kill(obj, query, width): +def kill(obj: UnifiedShellContext, query: ProcessQuery, width: int) -> None: log_pm_cmd(obj) - return kill_impl(obj, query, width) + kill_impl(cast(ProcessManagerContext, obj), query, width) @click.command("flush") @session_injector @add_query_options_no_session(at_least_one=True) @flush_decorators -def flush(obj, query, width): +def flush(obj: UnifiedShellContext, query: ProcessQuery, width: int) -> None: log_pm_cmd(obj) - return flush_impl(obj, query, width) + flush_impl(cast(ProcessManagerContext, obj), query, width) @click.command("restart") @session_injector @add_query_options_no_session(at_least_one=True) @click.pass_obj -def restart(obj, query): +def restart(obj: UnifiedShellContext, query: ProcessQuery) -> None: log_pm_cmd(obj) - return restart_impl(obj, query) + restart_impl(cast(ProcessManagerContext, obj), query) @click.command("start-shell") @click.pass_obj @click.pass_context -def start_shell(ctx, obj): +def start_shell(ctx: click.core.Context, obj: UnifiedShellContext) -> None: """ Start an interactive shell session. diff --git a/src/drunc/unified_shell/context.py b/src/drunc/unified_shell/context.py index 1e28ed084..8d279bbb0 100644 --- a/src/drunc/unified_shell/context.py +++ b/src/drunc/unified_shell/context.py @@ -1,5 +1,6 @@ -from collections.abc import Mapping +from collections.abc import MutableMapping from enum import Enum +from multiprocessing.context import Process import grpc from druncschema.process_manager_pb2 import ProcessQuery @@ -19,12 +20,12 @@ class UnifiedShellMode(Enum): class UnifiedShellContext(ShellContext): # boilerplatefest shell_id = "unified_shell" - def __init__(self): + def __init__(self) -> None: self.log = None self.status_receiver_pm = None self.status_receiver_controller = None self.took_control = False - self.pm_process = None + self.pm_process: Process | None = None self.address_pm = "" self.address_controller = "" self.configuration_file = "" @@ -32,15 +33,19 @@ def __init__(self): self.session_name = "" self.override_logs = True self.running_mode = UnifiedShellMode.INTERACTIVE - self.batch_commands: list(str) = [] + self.batch_commands: list[str] = [] super(UnifiedShellContext, self).__init__() - def reset(self, address_pm: str = ""): + def reset(self, *args: object, **kwargs: object) -> None: + address_pm_raw = kwargs.get("address_pm") + if address_pm_raw is None and args: + address_pm_raw = args[0] + address_pm = str(address_pm_raw) if address_pm_raw is not None else "" self.address_pm = resolve_localhost_to_hostname(address_pm) super(UnifiedShellContext, self)._reset(name="unified_shell") - def create_drivers(self, **kwargs) -> Mapping[str, object]: - ret = {} + def create_drivers(self, **kwargs: object) -> MutableMapping[str, object]: + ret: MutableMapping[str, object] = {} if self.address_pm != "": from drunc.process_manager.process_manager_driver import ( ProcessManagerDriver, @@ -54,17 +59,20 @@ def create_drivers(self, **kwargs) -> Mapping[str, object]: from drunc.controller.controller_driver import ControllerDriver ret["controller"] = ControllerDriver( - self.address, + self.address_controller, self._token, ) return ret - def set_controller_driver(self, address_controller, **kwargs) -> None: - self.address_controller = address_controller + def set_controller_driver( + self, address_controller: str | None, **kwargs: object + ) -> None: + self.address_controller = address_controller or "" from drunc.controller.controller_driver import ControllerDriver if address_controller is None: - del self._drivers["controller"] + if "controller" in self._drivers: + del self._drivers["controller"] return self._drivers["controller"] = ControllerDriver( @@ -72,7 +80,7 @@ def set_controller_driver(self, address_controller, **kwargs) -> None: self._token, ) - def create_token(self, **kwargs) -> Token: + def create_token(self, **kwargs: object) -> Token: from drunc.utils.shell_utils import create_dummy_token_from_uname token = create_dummy_token_from_uname() diff --git a/src/drunc/unified_shell/mypy_out.md b/src/drunc/unified_shell/mypy_out.md new file mode 100644 index 000000000..516d02d55 --- /dev/null +++ b/src/drunc/unified_shell/mypy_out.md @@ -0,0 +1,811 @@ +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/grpc_settings.py:6: error: Need type annotation for "MANAGER_SERVER_GRPC_CONFIG" (hint: "MANAGER_SERVER_GRPC_CONFIG: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/grpc_settings.py:7: error: Need type annotation for "MANAGER_CLIENT_GRPC_CONFIG" (hint: "MANAGER_CLIENT_GRPC_CONFIG: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/grpc_settings.py:8: error: Need type annotation for "CONTROLLER_SERVER_GRPC_CONFIG" (hint: "CONTROLLER_SERVER_GRPC_CONFIG: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/grpc_settings.py:9: error: Need type annotation for "CONTROLLER_CLIENT_GRPC_CONFIG" (hint: "CONTROLLER_CLIENT_GRPC_CONFIG: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/connection_utils.py:5: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/process_metadata.py:27: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/process_metadata.py:40: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:5: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:13: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:13: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:17: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:17: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:21: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:25: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:29: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:33: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:33: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:37: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:37: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:41: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:45: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:49: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:49: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:53: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:53: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/client_side_state.py:57: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_shell_process.py:7: error: Skipping analyzing "sh": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_shell_process.py:16: error: Argument 2 to "__init__" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/exceptions.py:5: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager.py:51: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/grpc_utils.py:93: error: "type[T]" has no attribute "DESCRIPTOR" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/grpc_utils.py:94: error: Argument 2 to "UnpackingError" has incompatible type "type[T]"; expected "type[Message]" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/utils.py:370: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/utils.py:370: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:14: error: Library stubs not installed for "paramiko" [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:14: note: Hint: "python3 -m pip install types-paramiko" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:60: error: Type of variable becomes "dict[str, Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:61: error: Type of variable becomes "dict[str, Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:95: error: Missing return statement [return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:95: error: Function "builtins.any" is not valid as a type [valid-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:95: note: Perhaps you meant "typing.Any" instead of "any"? +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:127: error: Returning Any from function declared to return "dict[str, any?]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:134: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:166: error: Return type becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:247: error: Argument 2 to "_add_identity_file" of "SSHProcessLifetimeManagerParamiko" has incompatible type "None"; expected "list[str]" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:263: error: Argument 2 to "_add_identity_file" of "SSHProcessLifetimeManagerParamiko" has incompatible type "None"; expected "list[str]" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:373: error: Incompatible types in assignment (expression has type "ProcessMetadata | None", variable has type "ProcessMetadata") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:379: error: Argument 1 to "_is_remote_process_alive" of "SSHProcessLifetimeManagerParamiko" has incompatible type "str | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:379: error: Argument 2 to "_is_remote_process_alive" of "SSHProcessLifetimeManagerParamiko" has incompatible type "str | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:379: error: Argument 3 to "_is_remote_process_alive" of "SSHProcessLifetimeManagerParamiko" has incompatible type "int | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:485: error: Signature of "kill_all_processes" incompatible with supertype "drunc.processes.ssh_process_lifetime_manager.ProcessLifetimeManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:485: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:485: note: def kill_all_processes(self, process_timeouts: dict[str, float] | None = ...) -> dict[str, ExitStatus | None] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:485: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:485: note: def kill_all_processes(self) -> dict[str, int | None] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:518: error: Argument 3 to "_start_process_watcher" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:538: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:538: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:541: error: Incompatible types in assignment (expression has type "ProcessMetadata | None", target has type "ProcessMetadata") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:650: error: Returning Any from function declared to return "list[str]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:664: error: Return type "dict[str, int | None]" of "kill_processes" incompatible with return type "dict[str, ExitStatus | None]" in supertype "drunc.processes.ssh_process_lifetime_manager.ProcessLifetimeManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:671: error: Return type "dict[str, int | None]" of "kill_processes_by_role" incompatible with return type "dict[str, ExitStatus | None]" in supertype "drunc.processes.ssh_process_lifetime_manager.ProcessLifetimeManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:749: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:794: error: Return type becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:802: error: Incompatible default for parameter "env_vars" (default has type "None", parameter has type "dict[str, str]") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:802: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:802: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:854: error: Argument 3 to "_kill_process_channel" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:878: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:890: error: Return type "int | None" of "kill_process" incompatible with return type "ExitStatus | None" in supertype "drunc.processes.ssh_process_lifetime_manager.ProcessLifetimeManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:918: error: Returning Any from function declared to return "int | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:937: error: Argument 1 to "_create_ssh_client" of "SSHProcessLifetimeManagerParamiko" has incompatible type "str | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:937: error: Argument 2 to "_create_ssh_client" of "SSHProcessLifetimeManagerParamiko" has incompatible type "str | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:1012: error: Argument 2 to "_send_remote_signal" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:1049: error: Returning Any from function declared to return "bool" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_paramiko.py:1056: error: Argument 2 to "_cleanup_remote_file_paramiko" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/flask_manager.py:10: error: Library stubs not installed for "psutil" [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/flask_manager.py:10: note: Hint: "python3 -m pip install types-psutil" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:9: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:10: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:14: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:14: error: Type of decorated function contains type "Any" ("_Wrapped[[VarArg(Any), KwArg(Any)], Any, [Any, Any, Any], Any]") [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:20: error: Unexpected keyword argument "responses" for "Response" [call-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:20: note: "Response" defined in "druncschema.request_response_pb2" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/authoriser/decorators.py:23: error: Argument "data" to "Response" has incompatible type "PlainText"; expected "google.protobuf.any_pb2.Any | None" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/utils.py:9: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/utils.py:49: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/utils.py:63: error: Incompatible return value type (got "Any | None", expected "str") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/utils.py:66: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/utils.py:67: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/configuration.py:247: error: "object" has no attribute "get_dal" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:24: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:73: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:180: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:180: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:198: error: Returning Any from function declared to return "dict[Any, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:215: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/connectivity_service/client.py:215: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:190: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:375: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:393: error: Item "None" of "Context | None" has no attribute "command" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:395: error: Item "None" of "Context | None" has no attribute "get_parameter_source" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:395: error: Argument 1 to "get_parameter_source" of "Context" has incompatible type "str | Any | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:396: error: Item "None" of "Context | None" has no attribute "params" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:396: error: Invalid index type "str | Any | None" for "dict[str, Any]"; expected type "str" [index] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/utils/shell_utils.py:401: error: "object" has no attribute "send_msg" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:18: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:22: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:28: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:37: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:42: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:47: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:56: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:56: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:61: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:61: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:66: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:72: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:72: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:77: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:77: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:82: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:82: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:108: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:114: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:117: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:117: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:119: error: Unexpected keyword argument "message" [call-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:119: error: Unexpected keyword argument "custom_origin" [call-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:129: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:132: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:135: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:138: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:141: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:144: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:147: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:150: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:153: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:153: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:158: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:158: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:163: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:166: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:166: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:169: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:169: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:172: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:175: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:185: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:206: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:234: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:244: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:254: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:264: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/stateful_node.py:277: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:36: error: Library stubs not installed for "grpc_status" [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:36: note: Hint: "python3 -m pip install types-grpcio-status" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:60: error: "object" has no attribute "controller" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:62: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:72: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:88: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:90: error: Non-overlapping equality check (left operand type: "str", right operand type: "Literal[0]") [comparison-overlap] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:98: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:98: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:101: error: Cannot determine type of "channel" [has-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:102: error: Cannot determine type of "channel" [has-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:139: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:190: error: Incompatible types in assignment (expression has type "None", variable has type "Channel") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:260: error: Returning Any from function declared to return "StatusResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:288: error: Returning Any from function declared to return "DescribeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:318: error: Returning Any from function declared to return "DescribeFSMResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:348: error: Returning Any from function declared to return "ExecuteFSMCommandResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:378: error: Returning Any from function declared to return "ExecuteExpertCommandResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:407: error: Returning Any from function declared to return "IncludeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:436: error: Returning Any from function declared to return "ExcludeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:464: error: Returning Any from function declared to return "RecomputeStatusResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:492: error: Returning Any from function declared to return "TakeControlResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:520: error: Returning Any from function declared to return "SurrenderControlResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:548: error: Returning Any from function declared to return "WhoIsInChargeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:576: error: Returning Any from function declared to return "ToErrorResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/grpc_child.py:605: error: Incompatible types in assignment (expression has type "PlainText", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:9: error: Library stubs not installed for "jsonschema" [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:9: note: Hint: "python3 -m pip install types-jsonschema" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:11: error: Skipping analyzing "kafkaopmon.OpMonPublisher": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:12: error: Skipping analyzing "opmonlib.publisher": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:13: error: Skipping analyzing "opmonlib.utils": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:50: error: Need type annotation for "environment" (hint: "environment: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:51: error: Need type annotation for "settings" (hint: "settings: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:56: error: Incompatible types in assignment (expression has type "object", variable has type "dict[Any, Any]") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:57: error: Incompatible types in assignment (expression has type "object", variable has type "dict[Any, Any]") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:61: error: "object" has no attribute "lower" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:80: error: "ConfHandler" has no attribute "log_path" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:82: error: Incompatible return value type (got "ConfHandler", expected "Self") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:84: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:128: error: Argument 2 to "get_commandline_parameters" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:128: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:207: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:218: error: Returning Any from function declared to return "dict[str, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:227: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:239: error: Returning Any from function declared to return "dict[str, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:247: error: Returning Any from function declared to return "dict[str, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:255: error: Returning Any from function declared to return "dict[str, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/configuration.py:264: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:120: error: Returning Any from function declared to return "StatusResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:141: error: Returning Any from function declared to return "DescribeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:164: error: Returning Any from function declared to return "DescribeFSMResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:187: error: Returning Any from function declared to return "ExecuteFSMCommandResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:210: error: Returning Any from function declared to return "ExecuteExpertCommandResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:231: error: Returning Any from function declared to return "IncludeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:252: error: Returning Any from function declared to return "ExcludeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:273: error: Returning Any from function declared to return "RecomputeStatusResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:294: error: Returning Any from function declared to return "TakeControlResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:315: error: Returning Any from function declared to return "SurrenderControlResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:336: error: Returning Any from function declared to return "WhoIsInChargeResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:357: error: Returning Any from function declared to return "ToErrorResponse" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:359: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/controller_driver.py:376: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:4: error: Skipping analyzing "confmodel_dal": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:35: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:89: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:108: error: Argument 1 to "component_disabled_from_session_dal" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:147: error: Argument 3 to "collect_apps" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:147: error: Argument 4 to "collect_apps" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:156: error: Missing type arguments for generic type "Dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:285: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:317: error: Returning Any from function declared to return "str | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:322: error: Argument 1 to "collect_infra_apps" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:322: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/oks_parser.py:378: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:52: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:52: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:56: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:56: error: Type of decorated function contains type "Any" ("def (session: Any, name: Any, user: Any, uuid: Any, **kwargs: Any) -> Any") [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:87: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:98: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:100: error: Need type annotation for "by_session" (hint: "by_session: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:108: error: Need type annotation for "node_by_id" (hint: "node_by_id: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:109: error: Need type annotation for "children" (hint: "children: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:132: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:136: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:147: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:159: error: Argument 1 to "order_process_by_name" has incompatible type "RepeatedCompositeFieldContainer[ProcessInstance]"; expected "list[ProcessInstance]" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:203: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:220: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:229: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:238: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:248: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:257: error: Argument 1 to "join" has incompatible type "str | None"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:264: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:269: error: Incompatible default for parameter "app_log_path" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:269: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:269: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:270: error: Incompatible default for parameter "session_log_path" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:270: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:270: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:302: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:307: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:307: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:359: error: Incompatible types in assignment (expression has type "ConfHandler", variable has type "ProcessManagerConfHandler") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/utils.py:361: error: Argument 3 to "getattr" has incompatible type "ConfTypes"; expected "ProcessManagerTypes" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:14: error: Incompatible types in assignment (expression has type "str", base class "ShellContext" defined the type as "None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:16: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:16: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: error: Signature of "reset" incompatible with supertype "drunc.utils.shell_utils.ShellContext" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: def reset(self, **kwargs: object) -> None +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: def reset(self, address: str = ...) -> Any +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: error: Incompatible default for parameter "address" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:21: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:27: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:27: error: Return type "Mapping[str, object]" of "create_drivers" incompatible with return type "MutableMapping[str, object]" in supertype "drunc.utils.shell_utils.ShellContext" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:32: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:35: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/context.py:35: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:15: error: Skipping analyzing "sh": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:73: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:73: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:565: error: Returning Any from function declared to return "bool" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:765: error: Need type annotation for "killed_uuids" (hint: "killed_uuids: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:1112: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:1354: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:1363: error: Returning Any from function declared to return "int | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_shell.py:1365: error: Returning Any from function declared to return "int | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:89: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:115: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:121: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:121: error: Missing return statement [return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:157: error: "ConnectivityServiceClient" object is not iterable [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:157: error: "None" object is not iterable [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:162: error: Need type annotation for "last_boot_on_host_at" (hint: "last_boot_on_host_at: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:243: error: Argument 3 to "_collect_all_apps" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:248: error: Missing type arguments for generic type "Dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:276: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:310: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:312: error: Missing type arguments for generic type "Dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:392: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:422: error: Incompatible types in "yield" (actual type "None", expected type "BootRequest") [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:425: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:425: error: Missing return statement [return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:447: error: Return value expected [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:449: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:450: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:473: error: Return type becomes "tuple[Any, Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:473: error: Argument 2 to "check_port_conflicts" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:473: error: Argument 3 to "check_port_conflicts" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:511: error: Incompatible types in assignment (expression has type "list[Any]", variable has type "int") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:516: error: Value of type "int" is not indexable [index] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:587: error: Missing type arguments for generic type "tuple" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:594: error: Argument 2 to "_connect_to_service" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:604: error: Incompatible return value type (got "tuple[ConnectivityServiceClient, Any, Any]", expected "ConnectivityServiceClient | None") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:605: error: Incompatible return value type (got "tuple[None, None, None]", expected "ConnectivityServiceClient | None") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:607: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:607: error: Argument 2 to "_discover_controller" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:626: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:629: error: Need type annotation for "env" (hint: "env: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: error: Argument 1 to "get_control_type_and_uri_from_connectivity_service" has incompatible type "ConnectivityServiceClient"; expected "_ConnectivityService" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: note: Following member(s) of "ConnectivityServiceClient" have conflicts: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: note: Expected: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: note: def resolve(self, name: str, message_type: str) -> list[dict[str, object]] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: note: Got: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:645: note: def resolve(self, uid_regex: str, data_type: str, ntries: Any = ...) -> dict[Any, Any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:795: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:859: error: Missing type arguments for generic type "list" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:874: error: Missing type arguments for generic type "list" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:913: error: Returning Any from function declared to return "ProcessInstanceList" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:933: error: Returning Any from function declared to return "ProcessInstanceList" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:954: error: Returning Any from function declared to return "LogLines | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:987: error: Returning Any from function declared to return "ProcessInstanceList" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:1008: error: Returning Any from function declared to return "ProcessInstanceList" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:1029: error: Returning Any from function declared to return "ProcessInstanceList" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:1048: error: Returning Any from function declared to return "Description" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:1052: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager_driver.py:1079: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/cli_argument.py:6: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/cli_argument.py:10: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/cli_argument.py:13: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/cli_argument.py:41: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/cli_argument.py:42: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:75: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:100: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:101: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:102: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:103: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:163: error: Cannot assign to a method [method-assign] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:240: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:241: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:242: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:247: error: Missing type arguments for generic type "Queue" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:256: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:299: error: Explicit "Any" is not allowed [explicit-any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:474: error: Returning Any from function declared to return "list[str]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:504: error: Returning Any from function declared to return "bool" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:517: error: Returning Any from function declared to return "ExitStatus | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:534: error: Returning Any from function declared to return "ExitStatus | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:556: error: Returning Any from function declared to return "ExitStatus | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:593: error: Returning Any from function declared to return "dict[str, ExitStatus | None]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:608: error: Returning Any from function declared to return "dict[str, ExitStatus | None]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:627: error: Returning Any from function declared to return "dict[str, ExitStatus | None]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:641: error: Returning Any from function declared to return "str | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:653: error: Returning Any from function declared to return "str | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:674: error: Returning Any from function declared to return "list[str]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:710: error: Returning Any from function declared to return "RemotePidResult" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/processes/ssh_process_lifetime_manager_from_forked_process.py:714: error: Returning Any from function declared to return "dict[str, int | None]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:14: error: Incompatible types in assignment (expression has type "str", base class "ShellContext" defined the type as "None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:16: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: error: Signature of "reset" incompatible with supertype "drunc.utils.shell_utils.ShellContext" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: note: def reset(self, **kwargs: object) -> None +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:20: note: def reset(self, address: str = ..., **kwargs: Any) -> Any +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:28: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:38: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:41: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/context.py:41: note: Use "-> None" if function does not return a value +shell_utils.py:14: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +shell_utils.py:45: error: "Command" has no attribute "commands" [attr-defined] +shell_utils.py:49: error: Incompatible types in assignment (expression has type "Parameter", variable has type "Option") [assignment] +shell_utils.py:51: error: Argument 1 to "get" of "dict" has incompatible type "str | None"; expected "str" [arg-type] +shell_utils.py:67: error: "Context" has no attribute "get_driver" [attr-defined] +shell_utils.py:71: error: Item "None" of "ProcessManagerDriver | None" has no attribute "ps" [union-attr] +shell_utils.py:75: error: Name "process_list" already defined on line 71 [no-redef] +shell_utils.py:75: error: Item "None" of "ProcessManagerDriver | None" has no attribute "ps" [union-attr] +shell_utils.py:82: error: "Context" has no attribute "get_driver" [attr-defined] +shell_utils.py:101: error: Name "sub_cmd" already defined on line 45 [no-redef] +shell_utils.py:101: error: "Command" has no attribute "commands" [attr-defined] +shell_utils.py:104: error: Invalid type comment or annotation [valid-type] +shell_utils.py:104: note: Suggestion: use dict[...] instead of dict(...) +shell_utils.py:119: error: Function is missing a return type annotation [no-untyped-def] +shell_utils.py:119: error: Argument 2 to "generate_fsm_sequence_command" becomes "Any" due to an unfollowed import [no-any-unimported] +shell_utils.py:148: error: Type of variable becomes "dict[str, Any]" due to an unfollowed import [no-any-unimported] +shell_utils.py:166: error: "Command" has no attribute "commands" [attr-defined] +shell_utils.py:176: error: Invalid type comment or annotation [valid-type] +shell_utils.py:176: note: Suggestion: use list[...] instead of list(...) +shell_utils.py:176: error: "Command" has no attribute "commands" [attr-defined] +shell_utils.py:187: error: Missing type arguments for generic type "partial" [type-arg] +shell_utils.py:190: error: Incompatible types in assignment (expression has type "def (*args: Any, **kwargs: Any) -> Any", variable has type "partial[Any]") [assignment] +shell_utils.py:193: error: Name "param" already defined on line 180 [no-redef] +shell_utils.py:197: error: Name "param_name" already defined on line 193 [no-redef] +shell_utils.py:211: error: Name "cmd" already defined on line 187 [no-redef] +context.py:20: error: Incompatible types in assignment (expression has type "str", base class "ShellContext" defined the type as "None") [assignment] +context.py:22: error: Function is missing a return type annotation [no-untyped-def] +context.py:22: note: Use "-> None" if function does not return a value +context.py:35: error: Invalid type comment or annotation [valid-type] +context.py:35: note: Suggestion: use list[...] instead of list(...) +context.py:38: error: Function is missing a return type annotation [no-untyped-def] +context.py:38: error: Signature of "reset" incompatible with supertype "drunc.utils.shell_utils.ShellContext" [override] +context.py:38: note: Superclass: +context.py:38: note: def reset(self, **kwargs: object) -> None +context.py:38: note: Subclass: +context.py:38: note: def reset(self, address_pm: str = ...) -> Any +context.py:42: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +context.py:42: error: Return type "Mapping[str, object]" of "create_drivers" incompatible with return type "MutableMapping[str, object]" in supertype "drunc.utils.shell_utils.ShellContext" [override] +context.py:56: error: Incompatible types in assignment (expression has type "ControllerDriver", target has type "ProcessManagerDriver") [assignment] +context.py:57: error: "UnifiedShellContext" has no attribute "address"; maybe "address_pm"? [attr-defined] +context.py:62: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +context.py:75: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +context.py:104: error: "object" has no attribute "ps" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:44: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:84: error: Value of type "object" is not indexable [index] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:85: error: Argument 1 to "DummyAuthoriser" has incompatible type "ConfHandler"; expected "DummyAuthoriserConfHandler" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:87: error: Need type annotation for "process_store" (hint: "process_store: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:88: error: Need type annotation for "boot_request" (hint: "boot_request: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:92: error: Need type annotation for "expected_dead_applications" (hint: "expected_dead_applications: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:157: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:160: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:165: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:166: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:166: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:174: error: Need type annotation for "dead_processes_prev" (hint: "dead_processes_prev: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:175: error: Cannot determine type of "stop_event" [has-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:195: error: "None" has no attribute "publish" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:231: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:263: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:296: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:326: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:356: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:386: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:425: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:447: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:494: error: Function is untyped after decorator transformation [misc] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:562: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/process_manager.py:758: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:30: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:54: error: "ProcessLifetimeManager" not callable [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:63: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:107: error: Incompatible return value type (got "dict[str, object]", expected "dict[str, float]") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:155: error: Missing type arguments for generic type "list" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:169: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "kill_processes" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:185: error: Item "None" of "ExitStatus | Any | None" has no attribute "get_reported_exit_code" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:185: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "int | Any | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:200: error: Missing type arguments for generic type "list" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:285: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "read_log_file" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:304: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "get_process_stdout" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:305: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "get_process_stderr" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:320: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:320: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:371: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "start_process" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:394: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "is_process_alive" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:395: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "pop_early_exit_status" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:416: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "int | Any | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:464: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "get_remote_pid" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:470: error: Incompatible types in assignment (expression has type "str | Any | None", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:480: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "int | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:486: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:489: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "get_remote_pid" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:493: error: Incompatible types in assignment (expression has type "str | Any | None", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:506: error: Signature of "_send_msg_impl" incompatible with supertype "drunc.process_manager.process_manager.ProcessManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:506: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:506: note: def _send_msg_impl(self, msg: str | None = ..., peer: str | None = ...) -> OutcomeStatus +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:506: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:506: note: def _send_msg_impl(self, msg: str, peer: str) -> OutcomeStatus +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:544: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "kill_process" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:545: error: Argument 2 to "kill_process" of "ProcessLifetimeManager" has incompatible type "object"; expected "float" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:607: error: Missing type arguments for generic type "list" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:627: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "crash_process" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:633: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:673: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "is_process_alive" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:700: error: Argument "return_code" to "_build_process_instance" of "SSHProcessManager" has incompatible type "int | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:708: error: Item "None" of "ProcessLifetimeManager | None" has no attribute "kill_process" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager.py:709: error: Argument 2 to "kill_process" of "ProcessLifetimeManager" has incompatible type "object"; expected "float" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:30: error: Skipping analyzing "kubernetes": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:31: error: Skipping analyzing "kubernetes.client.rest": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:32: error: Skipping analyzing "kubernetes.config.config_exception": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:71: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:81: error: Need type annotation for "processed_uuids" (hint: "processed_uuids: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:179: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:224: error: Need type annotation for "managed_sessions" (hint: "managed_sessions: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:225: error: Need type annotation for "watchers" (hint: "watchers: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:227: error: Need type annotation for "sessions_pending_deletion" (hint: "sessions_pending_deletion: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:228: error: Need type annotation for "uuids_pending_deletion" (hint: "uuids_pending_deletion: set[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:230: error: Need type annotation for "final_exit_codes" (hint: "final_exit_codes: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:238: error: Need type annotation for "_host_cache" (hint: "_host_cache: dict[, ] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:330: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:421: error: Returning Any from function declared to return "bool" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:574: error: Returning Any from function declared to return "bool | None" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:694: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:758: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:902: error: Return type becomes "tuple[list[Any], list[Any]]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1111: error: Return type becomes "list[Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1166: error: Unsupported left operand type for + ("None") [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1166: note: Left operand is of type "Any | None" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1198: error: Return type becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1198: error: Argument 5 to "_build_pod_main_container" becomes "list[Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1356: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1391: error: Return type becomes "list[Any] | None" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1498: error: Return type becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1498: error: Argument 4 to "_build_pod_manifest" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1498: error: Argument 6 to "_build_pod_manifest" becomes "list[Any] | None" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1498: error: Argument 7 to "_build_pod_manifest" becomes "list[Any]" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1503: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1563: error: Argument 4 to "_execute_pod_creation_api" becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1591: error: Returning Any from function declared to return "str" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1671: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1796: error: Incompatible return value type (got "None", expected "str") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1801: error: Returning Any from function declared to return "str" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1804: error: Incompatible return value type (got "None", expected "str") [return-value] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1806: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: error: Signature of "_get_process_uid" incompatible with supertype "drunc.process_manager.process_manager.ProcessManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: def _get_process_uid(self, query: ProcessQuery, in_boot_request: bool = ..., order_by: str = ...) -> list[str] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: def _get_process_uid(self, query: ProcessQuery, order_by: str = ...) -> list[str] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: error: Incompatible default for parameter "order_by" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1891: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1971: error: Signature of "_send_msg_impl" incompatible with supertype "drunc.process_manager.process_manager.ProcessManager" [override] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1971: note: Superclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1971: note: def _send_msg_impl(self, msg: str | None = ..., peer: str | None = ...) -> OutcomeStatus +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1971: note: Subclass: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:1971: note: def _send_msg_impl(self, msg: str, peer: str) -> OutcomeStatus +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:2061: error: Returning Any from function declared to return "str" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:2474: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:2533: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/k8s_process_manager.py:2578: error: Need type annotation for "pods_by_role" [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager_paramiko_client.py:8: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager_paramiko_client.py:11: error: Argument "LifetimeManagerClass" to "__init__" of "SSHProcessManager" has incompatible type "type[SSHProcessLifetimeManagerParamiko]"; expected "ProcessLifetimeManager" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager_shell.py:8: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/ssh_process_manager_shell.py:11: error: Argument "LifetimeManagerClass" to "__init__" of "SSHProcessManager" has incompatible type "type[SSHProcessLifetimeManagerShellOnForkedProcess]"; expected "ProcessLifetimeManager" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/fsm/configuration.py:5: error: Skipping analyzing "conffwk.dal": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/fsm/configuration.py:19: error: Type of variable becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/fsm/configuration.py:21: error: Argument 4 to "_fill_pre_post_transition_sequence_oks" becomes "list[Any] | None" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/fsm/configuration.py:82: error: Target type of cast becomes "Any" due to an unfollowed import [no-any-unimported] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:55: error: "object" has no attribute "ps" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:70: error: "object" has no attribute "boot" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:90: error: "object" has no attribute "controller_address" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:150: error: "object" has no attribute "dummy_boot" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:190: error: "object" has no attribute "terminate" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:199: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:220: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:230: error: "object" has no attribute "kill" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:238: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:253: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:265: error: "object" has no attribute "flush" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:273: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:289: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:304: error: "object" has no attribute "logs" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:343: error: "object" has no attribute "restart" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:346: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:370: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/commands.py:383: error: "object" has no attribute "ps" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:74: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:100: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:186: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:219: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:226: error: "object" has no attribute "status" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:231: error: "object" has no attribute "describe" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:236: error: "ControllerContext" has no attribute "get_endpoint_display_host_overrides" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:246: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:259: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:259: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:267: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:268: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:268: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:299: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:392: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:394: error: "FSMCommand" has no attribute "name" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:404: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:410: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:416: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:422: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:428: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:435: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:441: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:480: error: Module "google.protobuf.any_pb2" is not valid as a type [valid-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:480: note: Perhaps you meant to use a protocol matching the module structure? +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:485: error: Name "arguments" already defined on line 457 [no-redef] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:494: error: Incompatible types in assignment (expression has type "google.protobuf.any_pb2.Any", variable has type "str | int | float | bool | None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:521: error: Incompatible types in assignment (expression has type "int_msg", variable has type "str | int | float | bool | None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:527: error: Incompatible types in assignment (expression has type "float_msg", variable has type "str | int | float | bool | None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:529: error: Incompatible types in assignment (expression has type "string_msg", variable has type "str | int | float | bool | None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:529: error: Argument "value" to "string_msg" has incompatible type "str | int | float"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:533: error: Incompatible types in assignment (expression has type "bool_msg", variable has type "str | int | float | bool | None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:533: error: Argument "value" to "bool_msg" has incompatible type "str | int | float"; expected "bool" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:540: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:542: error: Argument 1 to "pack_to_any" has incompatible type "str | int | float"; expected "Message" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:547: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:561: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:592: error: "object" has no attribute "status" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:594: error: "object" has no attribute "status" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:611: error: "object" has no attribute "describe_fsm" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:633: error: "DummyCommand" has no attribute "arguments" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:641: error: Argument "arguments" to "FSMCommand" has incompatible type "dict[str, int | bool | str | float | None]"; expected "Mapping[str, google.protobuf.any_pb2.Any] | None" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:645: error: "object" has no attribute "status" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:666: error: "object" has no attribute "execute_fsm_command" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:711: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:728: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:746: error: Argument 1 to "render_status_table" has incompatible type "UnifiedShellContext"; expected "ControllerContext" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:750: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:750: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:767: error: Missing type arguments for generic type "partial" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:772: error: Incompatible types in assignment (expression has type "def (*args: Any, **kwargs: Any) -> Any", variable has type "partial[Any]") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:782: error: Dict entry 0 has incompatible type "ValueType": "type[str]"; expected "int": "str | int | float" [dict-item] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:783: error: Dict entry 1 has incompatible type "ValueType": "type[int]"; expected "int": "str | int | float" [dict-item] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:784: error: Dict entry 2 has incompatible type "ValueType": "type[float]"; expected "int": "str | int | float" [dict-item] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:785: error: Dict entry 3 has incompatible type "ValueType": "type[bool]"; expected "int": "str | int | float" [dict-item] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:790: error: Invalid type comment or annotation [valid-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:790: note: Suggestion: use dict[...] instead of dict(...) +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:802: error: Incompatible types in assignment (expression has type "str | int | float | None", variable has type "ValueType") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:811: error: "ValueType" not callable [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:821: error: "ValueType" not callable [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/shell_utils.py:840: error: Incompatible types in assignment (expression has type "Command", variable has type "partial[Any]") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:34: error: Need type annotation for "_cleanup_coroutines" (hint: "_cleanup_coroutines: list[] = ...") [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:42: error: Incompatible default for parameter "log_path" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:42: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:42: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:43: error: Incompatible default for parameter "ready_event" (default has type "None", parameter has type "bool") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:43: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:43: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:44: error: Incompatible default for parameter "signal_handler" (default has type "None", parameter has type "bool") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:44: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:44: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:45: error: Incompatible default for parameter "generated_port" (default has type "None", parameter has type "bool") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:45: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:45: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:52: error: "bool" not callable [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:68: error: Incompatible types in assignment (expression has type "ConfHandler", variable has type "ProcessManagerConfHandler") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:107: error: "bool" has no attribute "value" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:117: error: "bool" has no attribute "set" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/process_manager/interface/process_manager.py:150: error: Argument 2 to "signal" has incompatible type "Callable[[int, FrameType], None]"; expected "Callable[[int, FrameType | None], Any] | int | Handlers | None" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:11: error: Library stubs not installed for "socks" [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:11: note: Hint: "python3 -m pip install types-PySocks" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:32: error: Skipping analyzing "flask_restful": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:67: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:88: error: "ResponseDispatcher" has no attribute "uri" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:88: error: "ResponseDispatcher" has no attribute "node_type" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:98: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:98: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:102: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:106: error: "type[ResponseListener]" has no attribute "port" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:107: error: "type[ResponseListener]" has no attribute "app" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:108: error: "type[ResponseListener]" has no attribute "api" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:108: error: "type[ResponseListener]" has no attribute "app" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:109: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:110: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:112: error: "type[ResponseListener]" has no attribute "dispatcher" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:113: error: "type[ResponseListener]" has no attribute "dispatcher" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:115: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:120: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:121: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:122: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:125: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:128: error: "type[ResponseListener]" has no attribute "app" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:129: error: "type[ResponseListener]" has no attribute "app" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:131: error: "type[ResponseListener]" has no attribute "port" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:131: error: "type[ResponseListener]" has no attribute "app" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:141: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:145: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:146: error: "type[ResponseListener]" has no attribute "port" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:149: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:153: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:153: note: Use "-> None" if function does not return a value +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:154: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:155: error: "type[ResponseListener]" has no attribute "queue" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:160: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:160: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:172: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:177: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:180: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:187: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:189: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:192: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:192: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:198: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:199: error: "type[ResponseListener]" has no attribute "log" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:202: error: "type[ResponseListener]" has no attribute "handlers" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:213: error: Incompatible default for parameter "proxy_host" (default has type "None", parameter has type "str") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:213: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:213: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:214: error: Incompatible default for parameter "proxy_port" (default has type "None", parameter has type "int") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:214: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:214: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:227: error: Need type annotation for "response_queue" [var-annotated] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:230: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:233: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:262: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:262: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:263: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:313: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:315: error: Missing type arguments for generic type "dict" [type-arg] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:348: error: Returning Any from function declared to return "dict[Any, Any]" [no-any-return] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:370: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:372: error: Unsupported left operand type for + ("None") [operator] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:372: note: Left operand is of type "Any | None" +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:373: error: Item "None" of "Any | None" has no attribute "runs_on" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:380: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:395: error: Argument "conf" to "FSM" has incompatible type "ConfHandler"; expected "ConfigProtocol" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:417: error: Argument "proxy_port" to "AppCommander" has incompatible type "int | None"; expected "int" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:560: error: "object" has no attribute "id" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/children_interface/rest_api_child.py:650: error: Item "None" of "str | None" has no attribute "upper" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:25: error: "object" has no attribute "describe_fsm" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:122: error: "object" has no attribute "recompute_status" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:136: error: "object" has no attribute "name" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:136: error: "object" has no attribute "address" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:147: error: "ControllerContext" has no attribute "set_controller_driver" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:154: error: Function is missing a return type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:164: error: "object" has no attribute "name" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:168: error: "object" has no attribute "address" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:208: error: "object" has no attribute "take_control" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:238: error: "object" has no attribute "surrender_control" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:254: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:281: error: "object" has no attribute "who_is_in_charge" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:297: error: "object" has no attribute "include" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:314: error: "object" has no attribute "exclude" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:357: error: "object" has no attribute "execute_expert_command" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:364: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/interface/commands.py:396: error: "object" has no attribute "to_error" [attr-defined] +commands.py:56: error: "ProcessManagerContext" has no attribute "session_name" [attr-defined] +commands.py:58: error: "object" has no attribute "ps" [attr-defined] +commands.py:66: error: "ProcessManagerContext" has no attribute "override_logs" [attr-defined] +commands.py:78: error: "object" has no attribute "boot" [attr-defined] +commands.py:79: error: "ProcessManagerContext" has no attribute "configuration_file" [attr-defined] +commands.py:80: error: "ProcessManagerContext" has no attribute "configuration_id" [attr-defined] +commands.py:104: error: "object" has no attribute "ps" [attr-defined] +commands.py:111: error: "object" has no attribute "controller_address" [attr-defined] +commands.py:115: error: "ProcessManagerContext" has no attribute "set_controller_driver" [attr-defined] +commands.py:130: error: "object" has no attribute "status" [attr-defined] +commands.py:140: error: "object" has no attribute "status" [attr-defined] +commands.py:142: error: "ProcessManagerContext" has no attribute "running_mode" [attr-defined] +commands.py:152: error: Function is missing a type annotation [no-untyped-def] +commands.py:169: error: Function is missing a type annotation [no-untyped-def] +commands.py:171: error: Function is missing a type annotation [no-untyped-def] +commands.py:171: error: Type of decorated function contains type "Any" ("def (*args: Any, **kwargs: Any) -> Any") [misc] +commands.py:182: error: Function is missing a type annotation [no-untyped-def] +commands.py:191: error: Function is missing a type annotation [no-untyped-def] +commands.py:200: error: Function is missing a type annotation [no-untyped-def] +commands.py:209: error: Function is missing a type annotation [no-untyped-def] +commands.py:218: error: Function is missing a type annotation [no-untyped-def] +commands.py:226: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:4: error: Skipping analyzing "confmodel_dal": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:7: error: Skipping analyzing "kafkaopmon.OpMonPublisher": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:8: error: Skipping analyzing "opmonlib.publisher": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:9: error: Skipping analyzing "opmonlib.utils": module is installed, but missing library stubs or py.typed marker [import-untyped] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:37: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:48: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:49: error: "object" has no attribute "get_dal" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:49: error: Item "None" of "OKSKey | None" has no attribute "session" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:51: error: Item "None" of "OKSKey | None" has no attribute "obj_uid" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:55: error: Item "None" of "OKSKey | None" has no attribute "obj_uid" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:123: error: "object" has no attribute "get_dal" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:123: error: Item "None" of "OKSKey | None" has no attribute "session" [union-attr] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:132: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:134: error: "object" has no attribute "_obj" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:139: error: Argument "config_filename" to "get_commandline_parameters" has incompatible type "object"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:154: error: Function is missing a type annotation [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:156: error: "object" has no attribute "_obj" [attr-defined] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:162: error: Argument "config_filename" to "get_commandline_parameters" has incompatible type "object"; expected "str" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:211: error: Function is missing a type annotation for one or more parameters [no-untyped-def] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: error: Argument 1 to "get_control_type_and_uri_from_connectivity_service" has incompatible type "ConnectivityServiceClient"; expected "_ConnectivityService" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: note: Following member(s) of "ConnectivityServiceClient" have conflicts: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: note: Expected: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: note: def resolve(self, name: str, message_type: str) -> list[dict[str, object]] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: note: Got: +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:226: note: def resolve(self, uid_regex: str, data_type: str, ntries: Any = ...) -> dict[Any, Any] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:247: error: Argument 2 to "gRPCChildNode" has incompatible type "ConfHandler"; expected "gRCPChildConfHandler" [arg-type] +/nfs/home/emmuhamm/nightly/NFD_DEV_260729_A9/pythoncode/drunc/src/drunc/controller/configuration.py:256: error: Argument 2 to "RESTAPIChildNode" has incompatible type "ConfHandler"; expected "RESTAPIChildNodeConfHandler" [arg-type] +shell.py:12: error: Library stubs not installed for "click_shell" [import-untyped] +shell.py:12: note: Hint: "python3 -m pip install types-click-shell" +shell.py:12: note: (or run "mypy --install-types" to install all missing stub packages) +shell.py:12: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports +shell.py:118: error: Function is untyped after decorator transformation [misc] +shell.py:330: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:330: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:331: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:342: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:342: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:343: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:369: error: "ConfHandler" has no attribute "controller"; maybe "controller_id"? [attr-defined] +shell.py:380: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:385: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:408: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:408: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:409: error: Argument 1 to "format_name_for_cli" has incompatible type "str | None"; expected "str" [arg-type] +shell.py:418: error: "Command" has no attribute "add_command" [attr-defined] +shell.py:426: error: Function is missing a return type annotation [no-untyped-def] +shell.py:426: note: Use "-> None" if function does not return a value +shell.py:450: error: "Command" has no attribute "commands" [attr-defined] +shell.py:451: error: "Command" has no attribute "commands" [attr-defined] +shell.py:557: error: Argument 2 to "signal" has incompatible type "Callable[[int, FrameType], None]"; expected "Callable[[int, FrameType | None], Any] | int | Handlers | None" [arg-type] +shell.py:566: error: Function is missing a type annotation [no-untyped-def] +shell.py:566: error: Function is untyped after decorator transformation [misc] +shell.py:610: error: "Command" has no attribute "commands" [attr-defined] +shell.py:638: error: "Command" has no attribute "commands" [attr-defined] +shell.py:669: error: Argument 1 to "DruncBatchShellError" has incompatible type "NoSuchOption"; expected "str" [arg-type] +shell.py:672: error: Argument 1 to "DruncBatchShellArgError" has incompatible type "list[str]"; expected "str" [arg-type] +shell.py:675: error: Argument 1 to "DruncBatchShellError" has incompatible type "ClickException"; expected "str" [arg-type] +Found 705 errors in 44 files (checked 5 source files) diff --git a/src/drunc/unified_shell/shell.py b/src/drunc/unified_shell/shell.py index c939ffa33..750626b4d 100644 --- a/src/drunc/unified_shell/shell.py +++ b/src/drunc/unified_shell/shell.py @@ -6,6 +6,7 @@ import sys import types from time import sleep +from typing import cast from urllib.parse import ParseResult, urlparse import click @@ -125,7 +126,7 @@ def unified_shell( override_logs: bool, log_path: str, safe_mode: bool, -) -> None: +) -> None: # type: ignore[misc] """ The unified shell is a command line interface to interact with the process manager and the controller. It can start a process manager if a configuration file is @@ -323,12 +324,14 @@ def unified_shell( f"{getpass.getuser()} connected from unified shell" ) + command_group = cast(click.Group, ctx.command) + # Add the unified shell Click commands to the CLI ctx.obj.log.debug("Adding [green]unified_shell[/green] commands") unified_shell_commands = [boot, ps, terminate] for cmd in unified_shell_commands: - ctx.command.add_command(cmd, format_name_for_cli(cmd.name)) - ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name)) + command_group.add_command(cmd, format_name_for_cli(cmd.name or "")) + ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name or "")) # Add the process manager Click commands to the CLI ctx.obj.log.debug("Adding [green]process_manager[/green] commands") @@ -339,22 +342,25 @@ def unified_shell( restart, ] for cmd in process_manager_commands: - ctx.command.add_command(cmd, format_name_for_cli(cmd.name)) - ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name)) + command_group.add_command(cmd, format_name_for_cli(cmd.name or "")) + ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name or "")) # Get all the controller commands by instantiating the stateful node defined in the # configuration and getting the FSM transitions from it. ctx.obj.log.debug("Defining the pseudo controller to get its FSM commands") controller_name = session_dal.segment.controller.id - controller_configuration = ControllerConfHandler.from_oks( - url=ctx.obj.configuration_file, - oks_key=OKSKey( - schema_file="schema/confmodel/dunedaq.schema.xml", - class_name="RCApplication", - obj_uid=controller_name, - session=ctx.obj.configuration_id, + controller_configuration = cast( + ControllerConfHandler, + ControllerConfHandler.from_oks( + url=ctx.obj.configuration_file, + oks_key=OKSKey( + schema_file="schema/confmodel/dunedaq.schema.xml", + class_name="RCApplication", + obj_uid=controller_name, + session=ctx.obj.configuration_id, + ), + session_name=ctx.obj.session_name, ), - session_name=ctx.obj.session_name, ) # Avoid setting up the ELISA logbook for the unified shell os.environ["DUNEDAQ_ELISA_LOGBOOK_APPARATUS"] = "unified_shell" @@ -377,12 +383,12 @@ def unified_shell( # Add the FSM transitions and sequences as Click commands to the CLI ctx.obj.log.debug("Adding [green]controller[/green] commands to the click context") for transition in transitions.commands: - ctx.command.add_command( + command_group.add_command( *generate_fsm_command(ctx.obj, transition, controller_name) ) ctx.obj.dynamic_commands.add(format_name_for_cli(transition.name)) for sequence in session_dal.segment.controller.fsm.command_sequences: - ctx.command.add_command( + command_group.add_command( *generate_fsm_sequence_command(ctx, sequence, controller_name) ) ctx.obj.dynamic_commands.add(format_name_for_cli(sequence.id)) @@ -405,8 +411,8 @@ def unified_shell( to_error, ] for cmd in controller_commands: - ctx.command.add_command(cmd, format_name_for_cli(cmd.name)) - ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name)) + command_group.add_command(cmd, format_name_for_cli(cmd.name or "")) + ctx.obj.dynamic_commands.add(format_name_for_cli(cmd.name or "")) parser = ctx.command.make_parser(ctx) _, extract_batch_args, _ = parser.parse_args(sys.argv[1:]) @@ -415,7 +421,7 @@ def unified_shell( # If any of the commands is in the click commands, set batch mode if ctx.obj.batch_commands: ctx.obj.running_mode = UnifiedShellMode.BATCH - ctx.command.add_command(start_shell, "start-shell") + command_group.add_command(start_shell, "start-shell") ctx.obj.dynamic_commands.add("start-shell") validate_chain(ctx, extract_batch_args) @@ -423,7 +429,7 @@ def unified_shell( if "start-shell" in ctx.obj.batch_commands: ctx.obj.running_mode = UnifiedShellMode.SEMIBATCH - def cleanup(): + def cleanup() -> None: """ Cleanup function to be called on exit. @@ -447,8 +453,8 @@ def cleanup(): ctx.obj.log.info( "Attempting graceful shutdown of the controller" ) - stop_run_cmd = ctx.command.commands.get("stop-run") - scrap_cmd = ctx.command.commands.get("scrap") + stop_run_cmd = command_group.commands.get("stop-run") + scrap_cmd = command_group.commands.get("scrap") if stop_run_cmd is not None: ctx.invoke(stop_run_cmd) else: @@ -541,7 +547,7 @@ def cleanup(): ctx.call_on_close(cleanup) # Handle SIGTERM to gracefully shutdown the unified_shell - def signal_sigterm_handler(signum: int, frame: types.FrameType) -> None: + def signal_sigterm_handler(signum: int, frame: types.FrameType | None) -> None: """ Handle the SIGTERM signal to gracefully shut down the unified_shell. @@ -563,7 +569,7 @@ def signal_sigterm_handler(signum: int, frame: types.FrameType) -> None: @unified_shell.result_callback() @click.pass_context -def _maybe_enter_shell(ctx, results, **_): +def _maybe_enter_shell(ctx: click.core.Context, results: object, **_: object) -> None: # type: ignore[misc] # If user requested interactive mode at the end if ctx.obj.running_mode == UnifiedShellMode.SEMIBATCH: sh = click_shell.make_click_shell(ctx, prompt=ctx.command.shell.prompt) @@ -607,7 +613,7 @@ def validate_chain(ctx: click.core.Context, chain_args: list[str]) -> None: ctx: Click context object containing the command registry. chain_args (list): Flattened list of tokens from extract_chain_tokens. """ - command_names = set(ctx.command.commands.keys()) + command_names = set(cast(click.Group, ctx.command).commands.keys()) def command_can_consume_more_positionals( command: click.Command, provided_args: list[str] @@ -635,7 +641,7 @@ def command_can_consume_more_positionals( cmd_args = cmd_args_real.copy() cmd_args_static = cmd_args_real.copy() - sub_cmd: click.Command = ctx.command.commands[cmd_name] + sub_cmd: click.Command = cast(click.Group, ctx.command).commands[cmd_name] # Validate the command as split by split_chain sub_cmd.make_context( @@ -666,10 +672,10 @@ def command_can_consume_more_positionals( raise DruncBatchShellMissingArg(prev_cmd_name, next_cmd_name) from e except click.NoSuchOption as e: - raise DruncBatchShellError(e) from e + raise DruncBatchShellError(str(e)) from e except click.UsageError as e: - raise DruncBatchShellArgError(cmd_args_static) from e + raise DruncBatchShellArgError(str(cmd_args_static)) from e except click.ClickException as e: - raise DruncBatchShellError(e) from e + raise DruncBatchShellError(str(e)) from e diff --git a/src/drunc/unified_shell/shell_utils.py b/src/drunc/unified_shell/shell_utils.py index 6f32b7aae..442a170d5 100644 --- a/src/drunc/unified_shell/shell_utils.py +++ b/src/drunc/unified_shell/shell_utils.py @@ -1,22 +1,44 @@ import functools +from collections.abc import Callable, Sequence +from typing import TYPE_CHECKING, Protocol, cast import click -import conffwk from druncschema.controller_pb2 import DescribeFSMResponse from druncschema.process_manager_pb2 import ProcessInstanceList, ProcessQuery from drunc.controller.controller_driver import ControllerDriver from drunc.exceptions import DruncException, DruncSetupException -from drunc.process_manager.process_manager_driver import ProcessManagerDriver +from drunc.unified_shell.context import UnifiedShellContext from drunc.utils.utils import format_name_for_cli, get_logger +if TYPE_CHECKING: + pass + + +class SequenceEntryLike(Protocol): + id: str + + +class SequenceOptionLike(Protocol): + name: str | None + default: str | int | float | bool | None + show_default: bool + required: bool + help: str | None + type: object + + +class FSMSequenceLike(Protocol): + id: str + sequence: Sequence[SequenceEntryLike] + def run_fsm_sequence( sequence_commands: list[str], sequence_command_opts_and_args: dict[str, list[str]], ctx: click.core.Context, - obj: click.core.Context, - **kwargs, + obj: UnifiedShellContext, + **kwargs: str | int | float | bool | None, ) -> None: """ Execute a command sequence by invoking individual commands in order. @@ -37,19 +59,25 @@ def run_fsm_sequence( """ logger = get_logger("unified_shell.shell_utils") logger.info(f"Running sequence: {sequence_commands}") + command_group = cast(click.Group, ctx.command) # Check all required parameters for all commands in the sequence before executing # any command for cmd_name in sequence_commands: # Get the sub-command to check its parameters - sub_cmd: click.core.Command = ctx.command.commands[cmd_name] + check_cmd: click.Command = command_group.commands[cmd_name] # Check if all required parameters for the sub-command are provided in kwargs # If any required parameter is missing, log an error and exit - for param in sub_cmd.get_params(ctx): # type: click.core.Option + for param in check_cmd.get_params(ctx): # If the parameter is required and not provided, log an error and return + if param.name is None: + continue if param.required and kwargs.get(param.name) is None: - flag_display = param.opts[0] if param.opts else param.name + if isinstance(param, click.Option): + flag_display = param.opts[0] if param.opts else param.name + else: + flag_display = param.name logger.error( f"Aborting sequence! Command '{cmd_name}' requires " f"'{flag_display}' but it was not provided." @@ -64,18 +92,17 @@ def run_fsm_sequence( # These commands are not stateful. If they are a part of the sequence, they # should be run regardless of their position in the sequence - pmd: ProcessManagerDriver | None = obj.get_driver( - "process_manager", quiet_fail=True - ) + pmd = obj.get_driver("process_manager", quiet_fail=True) + process_list: ProcessInstanceList | None = None if command == "boot": - process_list: ProcessInstanceList = pmd.ps(ProcessQuery(names=[".*"])) - if not process_list.values: # We haven't started anything yet + if pmd is not None: + process_list = pmd.ps(ProcessQuery(names=[".*"])) + if process_list is not None and not process_list.values: accepted_command.append("boot") elif command == "terminate": - process_list: ProcessInstanceList = pmd.ps(ProcessQuery(names=[".*"])) - if ( - process_list.values - ): # We have started something that needs to be terminated + if pmd is not None: + process_list = pmd.ps(ProcessQuery(names=[".*"])) + if process_list is not None and process_list.values: accepted_command.append("terminate") # Get the FSM commands that can be ran from the current state @@ -98,27 +125,29 @@ def run_fsm_sequence( continue # Get the sub-command to invoke - sub_cmd: click.core.Command = ctx.command.commands[command] + invoke_cmd: click.Command = command_group.commands[command] # Build command kwargs - cmd_kwargs: dict(str, bool | str | int | float | None) = { + cmd_kwargs: dict[str, bool | str | int | float | None] = { param.name: kwargs[param.name] - for param in sub_cmd.get_params(ctx) - if param.name in kwargs + for param in invoke_cmd.get_params(ctx) + if param.name is not None and param.name in kwargs } # Invoke the command with the appropriate kwargs try: logger.info(f"Running command: '{command}'") - ctx.invoke(sub_cmd, **cmd_kwargs) - except DruncException as e: + ctx.invoke(invoke_cmd, **cmd_kwargs) + except DruncException: logger.error(f"Error running command: '{command}'") - raise e + raise def generate_fsm_sequence_command( - ctx: click.core.Context, sequence: "conffwk.dal.FSMsequence", controller_name: str -): + ctx: click.core.Context, + sequence: FSMSequenceLike, + controller_name: str, +) -> tuple[click.Command, str]: """ Parse a FSM sequence and generate a Click command to run it. @@ -145,7 +174,8 @@ def generate_fsm_sequence_command( str, list[str] ] = {} # {sequence_command: [sequence_command_option_name]} - sequence_options: dict[str, conffwk.dal.FSMParameter] = {} # {option_name: option} + sequence_options: dict[str, SequenceOptionLike] = {} + command_group = cast(click.Group, ctx.command) command_ids: list[str] = [command.id for command in sequence.sequence] @@ -163,7 +193,7 @@ def generate_fsm_sequence_command( for command_id in command_ids: # type: str # Parse the sequence command id to match the Click command name command_name: str = format_name_for_cli(command_id) - if command_name not in ctx.command.commands.keys(): + if command_name not in command_group.commands.keys(): raise DruncSetupException( f"Command {command_name} required by sequence {sequence.id} not found in the command list!" ) @@ -173,44 +203,44 @@ def generate_fsm_sequence_command( sequence_str += f"{command_name} {middle_text}" # Gather the command parameters, add them to the command options and args - params: list(click.core.Option) = ctx.command.commands[command_name].get_params( - ctx - ) + params = command_group.commands[command_name].get_params(ctx) sequence_command_options[command_name] = [] - for param in params: #  type: click.core.Option - if param.name == "help": + for param in params: + if not isinstance(param, click.Option): + continue + if param.name in (None, "help"): continue sequence_command_options[command_name].append(param.name) - sequence_options[param.name] = param + sequence_options[param.name] = cast(SequenceOptionLike, param) # Construct the sequence function - cmd: functools.partial = functools.partial( + cmd_fn: Callable[..., None] = functools.partial( run_fsm_sequence, sequence_commands, sequence_command_options, ctx ) - cmd = click.pass_obj(cmd) + cmd_fn = click.pass_obj(cmd_fn) # Add click options to the function - for param_name, param in sequence_options.items(): # type: str, conffwk.dal.FSMParameter - if param.name == "help": + for option_name, option in sequence_options.items(): + if option.name == "help": continue - param_name: str = format_name_for_cli(param_name) - param_default: str | int | float | bool | None = ( - param.default if param.default is not None else None + option_name_cli = format_name_for_cli(option_name) + option_default: str | int | float | bool | None = ( + option.default if option.default is not None else None ) - cmd = click.option( - f"--{param_name}", - type=param.type, - default=param_default, - show_default=param.show_default, - required=param.required, - help=param.help, - )(cmd) + cmd_fn = click.option( + f"--{option_name_cli}", + type=option.type, + default=option_default, + show_default=option.show_default, + required=option.required, + help=option.help, + )(cmd_fn) # Transform the function into a Click command - cmd: click.core.Command = click.command( + cmd = click.command( name=format_name_for_cli(sequence.id), help=f"Run the sequence {sequence.id}: {sequence_str}", - )(cmd) + )(cmd_fn) return cmd, format_name_for_cli(sequence.id) diff --git a/src/drunc/utils/shell_utils.py b/src/drunc/utils/shell_utils.py index b0a6a0b16..72062f228 100644 --- a/src/drunc/utils/shell_utils.py +++ b/src/drunc/utils/shell_utils.py @@ -3,7 +3,16 @@ import abc import getpass from collections.abc import MutableMapping -from typing import Callable, ParamSpec, Protocol, TypeVar, cast +from typing import ( + TYPE_CHECKING, + Callable, + Literal, + ParamSpec, + Protocol, + TypeVar, + cast, + overload, +) import click from druncschema.token_pb2 import Token @@ -12,6 +21,10 @@ from drunc.exceptions import DruncShellException from drunc.utils.utils import get_logger +if TYPE_CHECKING: + from drunc.controller.controller_driver import ControllerDriver + from drunc.process_manager.process_manager_driver import ProcessManagerDriver + class CommandLike(Protocol): """Protocol for command-like objects.""" @@ -185,7 +198,9 @@ def __str__(self) -> str: class ShellContext: """Base class for shell contexts.""" - shell_id = None # used for logging if its a PM shell or Unified shell etc + shell_id: str | None = ( + None # used for logging if its a PM shell or Unified shell etc + ) def get_shell_id(self): return self.shell_id @@ -193,9 +208,13 @@ def get_shell_id(self): def _reset( self, name: str, - token_args: dict[str, object] = {}, - driver_args: dict[str, object] = {}, + token_args: dict[str, object] | None = None, + driver_args: dict[str, object] | None = None, ) -> None: + if token_args is None: + token_args = {} + if driver_args is None: + driver_args = {} self._console = Console() self._token = self.create_token(**token_args) self._drivers: MutableMapping[str, object] = self.create_drivers(**driver_args) @@ -216,10 +235,11 @@ def __init__(self, *args: object, **kwargs: object) -> None: exit(1) @abc.abstractmethod - def reset(self, **kwargs: object) -> None: + def reset(self, *args: object, **kwargs: object) -> None: """Reset the shell context. Args: + *args: Additional positional arguments. **kwargs: Additional keyword arguments. """ pass @@ -267,7 +287,45 @@ def set_driver(self, name: str, driver: object) -> None: raise DruncShellException(f"Driver {name} already present in this context") self._drivers[name] = driver - def get_driver(self, name: str | None = None, quiet_fail: bool = False) -> object: + @overload + def get_driver( + self, name: Literal["controller"], quiet_fail: Literal[False] = False + ) -> "ControllerDriver": ... + + @overload + def get_driver( + self, name: Literal["controller"], quiet_fail: Literal[True] + ) -> "ControllerDriver | None": ... + + @overload + def get_driver( + self, name: Literal["process_manager"], quiet_fail: Literal[False] = False + ) -> "ProcessManagerDriver": ... + + @overload + def get_driver( + self, name: Literal["process_manager"], quiet_fail: Literal[True] + ) -> "ProcessManagerDriver | None": ... + + @overload + def get_driver(self, name: str, quiet_fail: Literal[False] = False) -> object: ... + + @overload + def get_driver(self, name: str, quiet_fail: Literal[True]) -> object | None: ... + + @overload + def get_driver( + self, name: None = None, quiet_fail: Literal[False] = False + ) -> object: ... + + @overload + def get_driver( + self, name: None = None, quiet_fail: Literal[True] = True + ) -> object | None: ... + + def get_driver( + self, name: str | None = None, quiet_fail: bool = False + ) -> object | None: """Get a driver from the context. Args: @@ -388,12 +446,18 @@ def log_pm_cmd(obj: ShellContext): """ ctx_cmd = click.get_current_context(silent=True) - cmd_name = ctx_cmd.command.name if ctx_cmd else None - parms_dict = {} - for param in ctx_cmd.command.params: - name = param.name - if ctx_cmd.get_parameter_source(name) == click.core.ParameterSource.COMMANDLINE: - parms_dict[name] = f"{ctx_cmd.params[name]!r}" + cmd_name = ctx_cmd.command.name if ctx_cmd and ctx_cmd.command else None + parms_dict: dict[str, str] = {} + if ctx_cmd and ctx_cmd.command: + for param in ctx_cmd.command.params: + name = param.name + if name is None: + continue + if ( + ctx_cmd.get_parameter_source(name) + == click.core.ParameterSource.COMMANDLINE + ): + parms_dict[name] = f"{ctx_cmd.params[name]!r}" args = f" with arguments {parms_dict}" if parms_dict else "" session = f" for session {obj.session_name}" if hasattr(obj, "session_name") else "" From 3e102d65a9b3e7c220a56f43e289c16dd3b25051 Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Wed, 29 Jul 2026 18:26:15 +0200 Subject: [PATCH 2/4] some stuff extra!! --- src/drunc/unified_shell/commands.py | 2 +- src/drunc/unified_shell/shell.py | 6 +++--- src/drunc/unified_shell/shell_utils.py | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/drunc/unified_shell/commands.py b/src/drunc/unified_shell/commands.py index 2d4a7c884..3d2e174a6 100644 --- a/src/drunc/unified_shell/commands.py +++ b/src/drunc/unified_shell/commands.py @@ -177,7 +177,7 @@ def session_injector(f: Callable[P, R]) -> Callable[P, R]: @click.pass_context def wrapper(ctx: click.core.Context, *args: P.args, **kwargs: P.kwargs) -> R: kwargs["session"] = ctx.obj.session_name - return cast(R, ctx.invoke(f, *args, **kwargs)) + return ctx.invoke(f, *args, **kwargs) return cast(Callable[P, R], update_wrapper(wrapper, f)) diff --git a/src/drunc/unified_shell/shell.py b/src/drunc/unified_shell/shell.py index 750626b4d..8b2739a3e 100644 --- a/src/drunc/unified_shell/shell.py +++ b/src/drunc/unified_shell/shell.py @@ -116,7 +116,7 @@ ), ) # For production, change default to true/remove it @click.pass_context -def unified_shell( +def unified_shell( # type: ignore[misc] ctx: click.core.Context, process_manager: str, configuration_file: str, @@ -126,7 +126,7 @@ def unified_shell( override_logs: bool, log_path: str, safe_mode: bool, -) -> None: # type: ignore[misc] +) -> None: """ The unified shell is a command line interface to interact with the process manager and the controller. It can start a process manager if a configuration file is @@ -572,7 +572,7 @@ def signal_sigterm_handler(signum: int, frame: types.FrameType | None) -> None: def _maybe_enter_shell(ctx: click.core.Context, results: object, **_: object) -> None: # type: ignore[misc] # If user requested interactive mode at the end if ctx.obj.running_mode == UnifiedShellMode.SEMIBATCH: - sh = click_shell.make_click_shell(ctx, prompt=ctx.command.shell.prompt) + sh = click_shell.make_click_shell(ctx, prompt="drunc-unified-shell > ") sh.cmdloop() diff --git a/src/drunc/unified_shell/shell_utils.py b/src/drunc/unified_shell/shell_utils.py index 442a170d5..a56ba3456 100644 --- a/src/drunc/unified_shell/shell_utils.py +++ b/src/drunc/unified_shell/shell_utils.py @@ -1,5 +1,5 @@ import functools -from collections.abc import Callable, Sequence +from collections.abc import Sequence from typing import TYPE_CHECKING, Protocol, cast import click @@ -214,10 +214,10 @@ def generate_fsm_sequence_command( sequence_options[param.name] = cast(SequenceOptionLike, param) # Construct the sequence function - cmd_fn: Callable[..., None] = functools.partial( + base_cmd_fn = functools.partial( run_fsm_sequence, sequence_commands, sequence_command_options, ctx ) - cmd_fn = click.pass_obj(cmd_fn) + cmd_fn_with_obj = click.pass_obj(base_cmd_fn) # Add click options to the function for option_name, option in sequence_options.items(): @@ -228,19 +228,19 @@ def generate_fsm_sequence_command( option_default: str | int | float | bool | None = ( option.default if option.default is not None else None ) - cmd_fn = click.option( + cmd_fn_with_obj = click.option( f"--{option_name_cli}", type=option.type, default=option_default, show_default=option.show_default, required=option.required, help=option.help, - )(cmd_fn) + )(cmd_fn_with_obj) # Transform the function into a Click command cmd = click.command( name=format_name_for_cli(sequence.id), help=f"Run the sequence {sequence.id}: {sequence_str}", - )(cmd_fn) + )(cmd_fn_with_obj) return cmd, format_name_for_cli(sequence.id) From 59d8a283934d2b3843537ca091d944a2f811056b Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Thu, 30 Jul 2026 11:12:55 +0200 Subject: [PATCH 3/4] Also do it for apps --- pyproject.toml | 3 ++ src/drunc/apps/check_np0x_cluster.py | 44 +++++++++++++---- src/drunc/apps/check_np0x_hw_status.py | 30 ++++++++---- src/drunc/apps/controller.py | 2 +- src/drunc/apps/fake_daqapp_rest.py | 66 +++++++++++++++++++------- src/drunc/apps/pm.py | 2 +- src/drunc/apps/pm_shell.py | 2 +- src/drunc/apps/session_manager.py | 2 +- src/drunc/apps/ssh_doctor.py | 4 +- src/drunc/apps/ssh_validator.py | 6 ++- src/drunc/apps/unified_shell.py | 2 +- 11 files changed, 116 insertions(+), 47 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cfb9c327f..bc0fe9843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,5 +127,8 @@ module = [ "grpc_status", "kafkaopmon.*", "opmonlib.*", + "paramiko", + "pytz", + "sh", "socks", ] diff --git a/src/drunc/apps/check_np0x_cluster.py b/src/drunc/apps/check_np0x_cluster.py index 57b58ac42..46dcaa43d 100644 --- a/src/drunc/apps/check_np0x_cluster.py +++ b/src/drunc/apps/check_np0x_cluster.py @@ -1,6 +1,7 @@ import os import subprocess from concurrent.futures import ThreadPoolExecutor, as_completed +from typing import NotRequired, TypedDict import paramiko from rich import box @@ -8,6 +9,29 @@ from rich.live import Live from rich.table import Table + +class HostData(TypedDict): + """Data dictionary tracking the status of a single cluster host.""" + + alias: str + is_pingable: bool | None + ssh_key: str + key_color: str + cpu_count: str + total_cores: str + cpu_usage: str + cpu_model: str + model_color: str + ram_total: str + ram_usage: str + nfs_ok: bool + uptime: str + details: NotRequired[str] + ssh_key_status: NotRequired[str] + ssh_key_color: NotRequired[str] + status: NotRequired[str] + + # List of NP0x cluster hosts NP0X_CLUSTER_HOSTS = sorted( [ @@ -48,7 +72,7 @@ STYLE_OFFLINE = "[bold white on #444444] OFFLINE [/]" # Base template for host tracking -DEFAULT_HOST_DATA = { +DEFAULT_HOST_DATA: HostData = { "alias": "", "is_pingable": None, # None: Waiting, True: Up, False: Down "ssh_key": "Pending", @@ -65,18 +89,18 @@ } -class TrackingAutoAddPolicy(paramiko.MissingHostKeyPolicy): +class TrackingAutoAddPolicy(paramiko.MissingHostKeyPolicy): # type: ignore[misc, no-any-unimported] """ Custom policy to track missing host keys and update the result dict accordingly. """ - def __init__(self, res_dict): + def __init__(self, res_dict: HostData) -> None: """ Initialize with a reference to the result dictionary to update key status. """ self.res_dict = res_dict - def missing_host_key(self, client, hostname, key): + def missing_host_key(self, client: object, hostname: str, key: object) -> None: """ When a host key is missing, update the result dictionary to indicate that the key is being added. @@ -86,7 +110,7 @@ def missing_host_key(self, client, hostname, key): self.res_dict["key_color"] = "bold yellow" -def load_ssh_config() -> paramiko.SSHConfig: +def load_ssh_config() -> paramiko.SSHConfig: # type: ignore[no-any-unimported] """ Load the user's SSH configuration from ~/.ssh/config using Paramiko's SSHConfig class. @@ -146,7 +170,7 @@ def ping_host(hostname: str) -> bool: ) -def get_host_metrics(host_alias: str, ssh_config: paramiko.SSHConfig) -> dict: +def get_host_metrics(host_alias: str, ssh_config: paramiko.SSHConfig) -> HostData: # type: ignore[no-any-unimported] """ For a given host alias, perform the following checks: - Ping the host to determine if it's online. @@ -326,7 +350,7 @@ def get_host_metrics(host_alias: str, ssh_config: paramiko.SSHConfig) -> dict: return result -def generate_table(results_map: dict[str, str]) -> Table: +def generate_table(results_map: dict[str, HostData]) -> Table: """ Generate a Rich Table object to display the status of the NP0x cluster hosts. @@ -372,8 +396,8 @@ def generate_table(results_map: dict[str, str]) -> Table: # Iterate through the results_map and add a row to the table for each host. for host in NP0X_CLUSTER_HOSTS: # Retrieve the result dictionary for the current host - r = results_map.get(host) - hostname = r["alias"] if r else host + r = results_map.get(host, DEFAULT_HOST_DATA) + hostname = r["alias"] if r["alias"] else host # Host is Pingable if r["is_pingable"] is True: @@ -415,7 +439,7 @@ def generate_table(results_map: dict[str, str]) -> Table: return table -def main(): +def main() -> None: """ Main function to execute the NP0x cluster status check and display results in a live-updating table. diff --git a/src/drunc/apps/check_np0x_hw_status.py b/src/drunc/apps/check_np0x_hw_status.py index 473730314..44a823fdd 100644 --- a/src/drunc/apps/check_np0x_hw_status.py +++ b/src/drunc/apps/check_np0x_hw_status.py @@ -11,6 +11,7 @@ import sys from concurrent.futures import ThreadPoolExecutor, TimeoutError, as_completed from datetime import datetime +from typing import TypedDict import click import pytz @@ -21,8 +22,15 @@ from rich.table import Table +class HardwareStatus(TypedDict): + """Status dictionary returned by check_hardware.""" + + online: bool + fembs: list[bool] + + # --- DYNAMIC PATH SETUP --- -def setup_wib_path(): +def setup_wib_path() -> str | None: """ Sets up the path to the local copy of the dune-wib-firmware repository if it exists. @@ -67,8 +75,8 @@ def setup_wib_path(): if WIB_FW_SW_IFACE_PATH: try: - import wib_pb2 as wibpb - from wib import WIB + import wib_pb2 as wibpb # type: ignore[import-not-found, no-redef] + from wib import WIB # type: ignore[import-not-found, no-redef] WIB_LIB_AVAILABLE = True except (ImportError, ModuleNotFoundError): @@ -156,7 +164,7 @@ def setup_wib_path(): } -def check_hardware(ip: str) -> dict: +def check_hardware(ip: str) -> HardwareStatus: """ Checks the hardware status of a given IP address by first pinging it to determine if it is online, and if it is online, attempting to query its FEMB power status using @@ -180,7 +188,7 @@ def check_hardware(ip: str) -> dict: errors (e.g. timeouts, subprocess errors, gRPC errors, etc.). """ # Default state is 'In Progress' (None) - final_status = {"online": False, "fembs": [False] * 4} + final_status: HardwareStatus = {"online": False, "fembs": [False] * 4} try: # 1. Ping @@ -193,7 +201,7 @@ def check_hardware(ip: str) -> dict: final_status["online"] = True # 2. Protocol Check - if WIB_LIB_AVAILABLE: + if WIB is not None and wibpb is not None: try: wib_inst = WIB(ip) req = wibpb.GetFEMBStatus() @@ -214,7 +222,9 @@ def check_hardware(ip: str) -> dict: return final_status -def make_wib_table(category: str, wibs: dict[str, str], results_map: dict) -> Table: +def make_wib_table( + category: str, wibs: dict[str, str], results_map: dict[str, HardwareStatus | None] +) -> Table: """ Creates a Rich Table for a given category of WIBs, showing their online status and FEMB power status. @@ -281,7 +291,7 @@ def make_wib_table(category: str, wibs: dict[str, str], results_map: dict) -> Ta return table -def generate_display(results_map: dict) -> Table: +def generate_display(results_map: dict[str, HardwareStatus | None]) -> Table: """ Generates the overall display grid for the current results. @@ -326,7 +336,7 @@ def generate_display(results_map: dict) -> Table: "Each WIB is pinged first, then queried for FEMB status when reachable." ), ) -def main(): +def main() -> None: """ Prints the power status of the hardware defined in WIB_DATA. @@ -355,7 +365,7 @@ def main(): ] # Initialize results map as empty/None for all IPs to force dots initially - results = {ip: None for ip in all_ips} + results: dict[str, HardwareStatus | None] = {ip: None for ip in all_ips} # Define a ThreadPoolExecutor to check hardware in parallel, and a mapping of # futures to IPs diff --git a/src/drunc/apps/controller.py b/src/drunc/apps/controller.py index 67b1c334a..54059b834 100644 --- a/src/drunc/apps/controller.py +++ b/src/drunc/apps/controller.py @@ -2,7 +2,7 @@ from drunc.utils.utils import get_logger, get_root_logger -def main(): +def main() -> None: try: controller_cli() except Exception as e: diff --git a/src/drunc/apps/fake_daqapp_rest.py b/src/drunc/apps/fake_daqapp_rest.py index 7a87dc7fc..19eec0b20 100644 --- a/src/drunc/apps/fake_daqapp_rest.py +++ b/src/drunc/apps/fake_daqapp_rest.py @@ -6,11 +6,12 @@ import random import threading import time +from typing import NotRequired, TypedDict from urllib.parse import urlparse import conffwk import requests -from flask import Flask, Response, request +from flask import Flask, request from flask_restful import Api, Resource from drunc.connectivity_service.client import ConnectivityServiceClient @@ -21,6 +22,27 @@ resolve_localhost_and_127_ip_to_network_ip, ) +# TypedDicts for execute_command request structure +_CmdData = TypedDict( + "_CmdData", + { + "execution-time": int, + "seg_fault": int, + "throw": bool, + }, + total=False, +) + + +class CommandRequest(TypedDict): + """Expected structure for incoming DAQ application command requests.""" + + entry_state: str + exit_state: str + id: str + data: NotRequired[_CmdData] + + __version__ = "1.0.0" get_root_logger("info") log = get_logger("fake_daqapp_rest", rich_handler=True) @@ -34,8 +56,8 @@ def __init__(self, app_name: str): self.log = get_logger("fake_daqapp_rest.AppState") def send_response_to_response_listener( - self, address: str, txt: str, success: bool = True, data: dict = {} - ): + self, address: str, txt: str, success: bool = True, data: dict[str, object] = {} + ) -> None: data_to_send = { "success": success, "result": txt, @@ -57,8 +79,12 @@ def send_response_to_response_listener( self.log.exception(e) def execute_command( - self, req_data, answer_port, answer_host, remote_host - ) -> Response: + self, + req_data: CommandRequest, + answer_port: str, + answer_host: str | None, + remote_host: str | None, + ) -> None: # The following block simulates a failure of the app while executing a stateful # command. Thisserves uniquely to test the robustness of the Run Control when an # app exits upon running an applciation, and should not be used for any other @@ -77,7 +103,7 @@ def execute_command( entry_state = req_data["entry_state"] exit_state = req_data["exit_state"] command_id = req_data["id"] - data = req_data.get("data", {}) + data: _CmdData = req_data.get("data", {}) if self.executing_command: response_txt = "Already executing a command!!" @@ -121,9 +147,7 @@ def execute_command( if data.get("throw"): time.sleep(worries) - what = ( - "This is an eRrOr, YoU hAvE bEeN vErY nAuGhTy (aka task failed successfully)", - ) + what = "This is an eRrOr, YoU hAvE bEeN vErY nAuGhTy (aka task failed successfully)" self.log.info(what) self.send_response_to_response_listener( success=False, @@ -155,13 +179,13 @@ def execute_command( """ -class AppCommand(Resource): +class AppCommand(Resource): # type: ignore[misc, no-any-unimported] @classmethod - def pass_daq_app(cls, daq_app): + def pass_daq_app(cls, daq_app: "AppState") -> "type[AppCommand]": cls.daq_app = daq_app return cls - def post(self): + def post(self) -> tuple[str, int]: global app_state try: @@ -185,7 +209,12 @@ def post(self): return "Command received\n", 202 -def update_connectivity_service(name, connectivity_service, interval, url): +def update_connectivity_service( + name: str, + connectivity_service: ConnectivityServiceClient, + interval: int | float, + url: object, +) -> None: while True: connectivity_service.publish( name + "_control", @@ -195,15 +224,15 @@ def update_connectivity_service(name, connectivity_service, interval, url): time.sleep(interval) -def index(): +def index() -> str: return f"Fake DAQ app v{__version__}" -def get_address_for_conn_srv(hostname): +def get_address_for_conn_srv(hostname: str) -> str: return f"rest://{hostname}:{get_new_port()}" -def main(): +def main() -> None: # The following block simulates a failure during the initialization of the app. This # serves uniquely to test the robustness of the Run Control when an app fails to # initialize, and should not be used for any other purpose. The environment variable @@ -278,7 +307,8 @@ def main(): log.debug(f"Initializing fake_daq_application with address {url}") if url.port == 0: - url = get_address_for_conn_srv(url.hostname) + hostname = url.hostname or "localhost" + url = urlparse(get_address_for_conn_srv(hostname)) log.info(f"Communication address is {url}") interval = 2 @@ -307,7 +337,7 @@ def main(): api.add_resource(DAQAppCMD, "/command", methods=["POST"]) app.add_url_rule("/", "index", index) - url = urlparse(url) + url = urlparse(url) if isinstance(url, str) else url flask_url = url.geturl().replace("rest://", "http://") log.info(f"Starting FakeDAQ app on {flask_url}") diff --git a/src/drunc/apps/pm.py b/src/drunc/apps/pm.py index 6c8509c6d..590809d75 100644 --- a/src/drunc/apps/pm.py +++ b/src/drunc/apps/pm.py @@ -2,7 +2,7 @@ from drunc.utils.utils import get_logger, get_root_logger -def main(): +def main() -> None: try: process_manager_cli() except Exception as e: diff --git a/src/drunc/apps/pm_shell.py b/src/drunc/apps/pm_shell.py index eb74ad0c5..926a7c14d 100644 --- a/src/drunc/apps/pm_shell.py +++ b/src/drunc/apps/pm_shell.py @@ -3,7 +3,7 @@ from drunc.utils.utils import get_logger, get_root_logger -def main(): +def main() -> None: context = ProcessManagerContext() try: process_manager_shell(obj=context) diff --git a/src/drunc/apps/session_manager.py b/src/drunc/apps/session_manager.py index 47cc0a12d..c7970cc9e 100644 --- a/src/drunc/apps/session_manager.py +++ b/src/drunc/apps/session_manager.py @@ -2,7 +2,7 @@ from drunc.utils.utils import get_logger, get_root_logger -def main(): +def main() -> None: try: session_manager_cli() except Exception as e: diff --git a/src/drunc/apps/ssh_doctor.py b/src/drunc/apps/ssh_doctor.py index 65c60b7d1..966cc6b00 100755 --- a/src/drunc/apps/ssh_doctor.py +++ b/src/drunc/apps/ssh_doctor.py @@ -39,7 +39,7 @@ def test_host_connection(host: str, test_auth: str) -> bool: bool: True if the SSH connection is successful, False otherwise. """ - ssh_manager = SSHProcessLifetimeManagerParamiko(disable_host_key_check=True) + ssh_manager = SSHProcessLifetimeManagerParamiko(disable_host_key_check=True) # type: ignore[abstract] try: ssh_manager.validate_host_connection(host=host, auth_method=test_auth) @@ -125,7 +125,7 @@ def print_results(results: dict[str, dict[str, bool]]) -> None: default="INFO", help="Set the log level", ) -def main(log_level: str): +def main(log_level: str) -> None: """ Validate the ability to SSH onto all of the hosts required by the configuration session applications.\n\n diff --git a/src/drunc/apps/ssh_validator.py b/src/drunc/apps/ssh_validator.py index 42bbe0e45..8033ff54c 100644 --- a/src/drunc/apps/ssh_validator.py +++ b/src/drunc/apps/ssh_validator.py @@ -7,11 +7,13 @@ from sh import Command from drunc.process_manager.oks_parser import collect_apps -from drunc.process_manager.ssh_process_manager_paramiko_client import on_parent_exit +from drunc.process_manager.utils import on_parent_exit from drunc.utils.utils import get_logger -def validate_ssh_connection(configuration: str, session_name: str, log_level: str): +def validate_ssh_connection( + configuration: str, session_name: str, log_level: str +) -> None: log = get_logger("validate_ssh_connection", rich_handler=True) db = conffwk.Configuration(f"oksconflibs:{configuration}") diff --git a/src/drunc/apps/unified_shell.py b/src/drunc/apps/unified_shell.py index 1521ce3dd..f3b0b3b65 100644 --- a/src/drunc/apps/unified_shell.py +++ b/src/drunc/apps/unified_shell.py @@ -3,7 +3,7 @@ from drunc.utils.utils import get_logger, get_root_logger -def main(): +def main() -> None: context = UnifiedShellContext() try: From 31bf37093b5de0e040e408a7e8b391121bb94872 Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Mon, 3 Aug 2026 16:15:10 +0200 Subject: [PATCH 4/4] did a whole big block of mypy stuff --- pyproject.toml | 3 + src/drunc/apps/fake_daqapp_rest.py | 4 +- src/drunc/authoriser/decorators.py | 46 ++++- src/drunc/authoriser/exceptions.py | 4 +- src/drunc/connectivity_service/client.py | 15 +- .../grpc_testing_tools/child_controller.py | 37 ++-- .../child_controller_server_cli.py | 2 +- .../grpc_testing_tools/connection_utils.py | 10 +- .../grpc_log_file_manager.py | 13 +- src/drunc/grpc_testing_tools/grpc_log_util.py | 8 +- .../grpc_running_server_data.py | 62 ++++-- .../grpc_testing_tools/grpc_server_config.py | 14 +- .../grpc_testing_tools/grpc_server_manager.py | 13 +- .../multiprocessing_connection_manager.py | 30 ++- .../process_connection_manager.py | 15 +- .../grpc_testing_tools/process_manager.py | 185 ++++++++++++------ .../process_manager_server_cli.py | 2 +- .../grpc_testing_tools/root_controller.py | 37 ++-- .../root_controller_server_cli.py | 2 +- .../grpc_testing_tools/run_grpc_services.py | 61 +++--- src/drunc/utils/configuration.py | 8 +- src/drunc/utils/grpc_utils.py | 8 +- src/drunc/utils/shell_utils.py | 4 +- src/drunc/utils/utils.py | 2 +- 24 files changed, 393 insertions(+), 192 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bc0fe9843..556e9e3d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,8 @@ select = [ ] [tool.mypy] +exclude = "(?:^|/).*_pb2(?:_grpc)?\\.py$" + check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true @@ -128,6 +130,7 @@ module = [ "kafkaopmon.*", "opmonlib.*", "paramiko", + "psutil", "pytz", "sh", "socks", diff --git a/src/drunc/apps/fake_daqapp_rest.py b/src/drunc/apps/fake_daqapp_rest.py index 19eec0b20..0435bb353 100644 --- a/src/drunc/apps/fake_daqapp_rest.py +++ b/src/drunc/apps/fake_daqapp_rest.py @@ -213,7 +213,7 @@ def update_connectivity_service( name: str, connectivity_service: ConnectivityServiceClient, interval: int | float, - url: object, + url: str, ) -> None: while True: connectivity_service.publish( @@ -320,7 +320,7 @@ def main() -> None: connectivity_service_thread = threading.Thread( target=update_connectivity_service, - args=(name, connectivity_service, interval, url), + args=(name, connectivity_service, interval, url.geturl()), name="connectivity_service_updating_thread", ) diff --git a/src/drunc/authoriser/decorators.py b/src/drunc/authoriser/decorators.py index 61775a671..be63f8618 100644 --- a/src/drunc/authoriser/decorators.py +++ b/src/drunc/authoriser/decorators.py @@ -1,17 +1,49 @@ import functools +from typing import Callable, Protocol +import grpc from druncschema.generic_pb2 import PlainText from druncschema.request_response_pb2 import Response, ResponseFlag +from druncschema.token_pb2 import Token +from drunc.utils.grpc_utils import pack_to_any from drunc.utils.utils import get_logger -def authentified_and_authorised(action, system): - def decor(cmd): +class _AuthoriserProtocol(Protocol): + def is_authorised( + self, + token: Token, + action: int, + system: str, + command_name: str, + ) -> bool: ... + + +class _RequestProtocol(Protocol): + token: Token + + +class _ObjectProtocol(Protocol): + name: str + authoriser: _AuthoriserProtocol + + +_Command = Callable[[_ObjectProtocol, _RequestProtocol, grpc.ServicerContext], Response] + + +def authentified_and_authorised( + action: int, system: str +) -> Callable[[_Command], _Command]: + def decor(cmd: _Command) -> _Command: @functools.wraps( cmd ) # this nifty decorator of decorator (!) is nicely preserving the cmd.__name__ (i.e. signature) - def check_token(obj, request, context): + def check_token( + obj: _ObjectProtocol, + request: _RequestProtocol, + context: grpc.ServicerContext, + ) -> Response: log = get_logger("utils.authentified_and_authorised_decorator") log.debug("Entering") if not obj.authoriser.is_authorised( @@ -20,11 +52,13 @@ def check_token(obj, request, context): return Response( name=obj.name, token=request.token, - data=PlainText( - text=f"User {request.token.user_name} is not authorised to execute {cmd.__name__} on {obj.name} (action type is {action}, system is {system})" + data=pack_to_any( + PlainText( + text=f"User {request.token.user_name} is not authorised to execute {cmd.__name__} on {obj.name} (action type is {action}, system is {system})" + ) ), flag=ResponseFlag.NOT_EXECUTED_NOT_AUTHORISED, - responses=[], + children=[], ) # raise Unauthorised( diff --git a/src/drunc/authoriser/exceptions.py b/src/drunc/authoriser/exceptions.py index 85f65d595..bc05437a4 100644 --- a/src/drunc/authoriser/exceptions.py +++ b/src/drunc/authoriser/exceptions.py @@ -5,7 +5,9 @@ class Unauthorised(DruncCommandException): - def __init__(self, user, action, command, drunc_system): + def __init__( + self, user: str, action: ActionType.ValueType, command: str, drunc_system: str + ) -> None: self.user = user self.action = action self.action_name = ActionType.Name(action) diff --git a/src/drunc/connectivity_service/client.py b/src/drunc/connectivity_service/client.py index 5e7eb124f..6ff8b328b 100644 --- a/src/drunc/connectivity_service/client.py +++ b/src/drunc/connectivity_service/client.py @@ -1,4 +1,5 @@ import time +from typing import cast from requests.exceptions import ConnectionError, HTTPError, ReadTimeout @@ -7,7 +8,7 @@ class ConnectivityServiceClient: - def __init__(self, session: str, address: str): + def __init__(self, session: str, address: str) -> None: self.session = session self.log = get_logger("utils.ConnectivityServiceClient") @@ -21,7 +22,7 @@ def __init__(self, session: str, address: str): f"Connectivity service address: {self.address}, session: {self.session}" ) - def is_ready(self, timeout: int = 10): + def is_ready(self, timeout: int = 10) -> bool: """ Check if the service is ready by polling the connectivity service with an exponential backoff. @@ -70,7 +71,7 @@ def is_ready(self, timeout: int = 10): ) return False - def retract(self, uid, fail_quickly=False): + def retract(self, uid: str, fail_quickly: bool = False) -> None: data = { "partition": self.session, "connections": [ @@ -177,7 +178,9 @@ def retract_partition( if fail_quickly: return - def resolve(self, uid_regex: str, data_type: str, ntries=50) -> dict: + def resolve( + self, uid_regex: str, data_type: str, ntries: int = 50 + ) -> dict[str, object]: data = {"data_type": data_type, "uid_regex": uid_regex} for i in range(ntries): try: @@ -193,7 +196,7 @@ def resolve(self, uid_regex: str, data_type: str, ntries=50) -> dict: ignore_errors=True, ) response.raise_for_status() - content = response.json() + content = cast(dict[str, object], response.json()) if content: return content else: @@ -212,7 +215,7 @@ def resolve(self, uid_regex: str, data_type: str, ntries=50) -> dict: ) raise ApplicationLookupUnsuccessful - def publish(self, uid, uri, data_type: str): + def publish(self, uid: str, uri: str, data_type: str) -> None: for i in range(50): try: self.log.debug( diff --git a/src/drunc/grpc_testing_tools/child_controller.py b/src/drunc/grpc_testing_tools/child_controller.py index dd9a13a15..0378a487a 100644 --- a/src/drunc/grpc_testing_tools/child_controller.py +++ b/src/drunc/grpc_testing_tools/child_controller.py @@ -9,17 +9,25 @@ import os import signal import threading +from typing import Protocol, cast -from drunc.grpc_testing_tools.test_services_pb2 import ( - DummyResponse, - KillRequest, - KillResponse, -) +import grpc + +from drunc.grpc_testing_tools import test_services_pb2 as pb2 from drunc.grpc_testing_tools.test_services_pb2_grpc import ( ChildControllerServiceServicer, ) +class _Pb2ModuleProtocol(Protocol): + def DummyResponse(self, *args: object, **kwargs: object) -> object: ... + + def KillResponse(self, *args: object, **kwargs: object) -> object: ... + + +PB2 = cast(_Pb2ModuleProtocol, pb2) + + class ChildControllerServiceImpl(ChildControllerServiceServicer): """ Implementation of ChildController gRPC service. @@ -30,7 +38,7 @@ class ChildControllerServiceImpl(ChildControllerServiceServicer): instruction processing, and graceful shutdown requests. """ - def __init__(self, name: str): + def __init__(self, name: str) -> None: """ Initialise the ChildController service implementation. @@ -39,7 +47,7 @@ def __init__(self, name: str): """ self.name = name - def MakeRequest(self, request, context): + def MakeRequest(self, request: object, context: grpc.ServicerContext) -> object: """ Handle incoming connectivity test requests. @@ -50,17 +58,18 @@ def MakeRequest(self, request, context): Returns: DummyResponse with echoed message confirming ChildController is responsive """ - return DummyResponse(reply=f"{self.name} server response: {request.message}") + message = getattr(request, "message", "") + return PB2.DummyResponse(reply=f"{self.name} server response: {message}") - def Kill(self, request: KillRequest, context) -> KillResponse: + def Kill(self, request: object, context: grpc.ServicerContext) -> object: grace_period = ( - max(request.grace_period_seconds, 1) - if request.grace_period_seconds > 0 + max(getattr(request, "grace_period_seconds", 0), 1) + if getattr(request, "grace_period_seconds", 0) > 0 else 2 ) # Build detailed response message - reason = request.reason or "No reason provided" + reason = getattr(request, "reason", None) or "No reason provided" response_details = [ "Manager Kill method executed successfully", f"Reason: {reason}", @@ -69,7 +78,7 @@ def Kill(self, request: KillRequest, context) -> KillResponse: "Shutdown thread starting...", ] - def delayed_shutdown(): + def delayed_shutdown() -> None: """Send SIGTERM to this process after a brief delay.""" import time @@ -81,6 +90,6 @@ def delayed_shutdown(): shutdown_thread.daemon = True shutdown_thread.start() - return KillResponse( + return PB2.KillResponse( shutdown_initiated=True, message=" | ".join(response_details) ) diff --git a/src/drunc/grpc_testing_tools/child_controller_server_cli.py b/src/drunc/grpc_testing_tools/child_controller_server_cli.py index 3861cc252..3249b2cd0 100644 --- a/src/drunc/grpc_testing_tools/child_controller_server_cli.py +++ b/src/drunc/grpc_testing_tools/child_controller_server_cli.py @@ -12,7 +12,7 @@ from drunc.grpc_testing_tools.run_grpc_services import run_child_controller_server -def main(): +def main() -> None: """ Main entry point for ChildController server CLI. diff --git a/src/drunc/grpc_testing_tools/connection_utils.py b/src/drunc/grpc_testing_tools/connection_utils.py index 309172af3..5d7c45f8d 100644 --- a/src/drunc/grpc_testing_tools/connection_utils.py +++ b/src/drunc/grpc_testing_tools/connection_utils.py @@ -1,13 +1,15 @@ import time -from typing import Any, Callable, Optional +from typing import Callable, Optional, TypeVar + +T = TypeVar("T") def wait_for( - condition: Callable[[], Any], - expected_value: Any, + condition: Callable[[], T], + expected_value: object, timeout: float = 10.0, poll_interval: float = 0.1, -) -> Optional[Any]: +) -> Optional[T]: """ Wait for a condition to return an expected value within a timeout period. diff --git a/src/drunc/grpc_testing_tools/grpc_log_file_manager.py b/src/drunc/grpc_testing_tools/grpc_log_file_manager.py index 15c6e7be2..ad23d260f 100644 --- a/src/drunc/grpc_testing_tools/grpc_log_file_manager.py +++ b/src/drunc/grpc_testing_tools/grpc_log_file_manager.py @@ -25,11 +25,12 @@ class LogFileManager: cleanup after test completion to prevent file system clutter. """ - def __init__(self): + def __init__(self) -> None: """Initialise log file manager with empty state.""" - self.log_files = [] - self.file_positions = {} - self.temp_dir = None + self.log_files: list[str] = [] + self.file_positions: dict[str, int] = {} + self.temp_dir: str | None = None + self.detected_error: dict[str, object] | None = None def create_log_file(self, process_name: str) -> str: """ @@ -65,7 +66,7 @@ def get_all_log_files(self) -> List[str]: """ return self.log_files.copy() - def cleanup(self): + def cleanup(self) -> None: """Remove all log files and temporary directory.""" for log_file in self.log_files: try: @@ -109,7 +110,7 @@ def _scan_content_for_errors(self, content: str) -> List[str]: return detected_errors - def check_for_errors(self): + def check_for_errors(self) -> dict[str, object] | None: """ Check all log files for gRPC error patterns. diff --git a/src/drunc/grpc_testing_tools/grpc_log_util.py b/src/drunc/grpc_testing_tools/grpc_log_util.py index d57975cd3..1ffacee7d 100644 --- a/src/drunc/grpc_testing_tools/grpc_log_util.py +++ b/src/drunc/grpc_testing_tools/grpc_log_util.py @@ -3,7 +3,7 @@ import threading -def stderr_observer(log_file_name): +def stderr_observer(log_file_name: str) -> None: """ Redirect stderr to a log file for process output capture. @@ -15,7 +15,7 @@ def stderr_observer(log_file_name): os.dup2(w, stderr_fd) os.close(w) - def reader(): + def reader() -> None: log_handle = open(log_file_name, "a", buffering=1) with os.fdopen(r) as pipe: for line in pipe: @@ -27,7 +27,7 @@ def reader(): reader_thread.start() -def stdout_observer(log_file_name): +def stdout_observer(log_file_name: str) -> None: """ Redirect stdout to a log file for process output capture. @@ -39,7 +39,7 @@ def stdout_observer(log_file_name): os.dup2(w, stdout_fd) os.close(w) - def reader(): + def reader() -> None: log_handle = open(log_file_name, "a", buffering=1) with os.fdopen(r) as pipe: for line in pipe: diff --git a/src/drunc/grpc_testing_tools/grpc_running_server_data.py b/src/drunc/grpc_testing_tools/grpc_running_server_data.py index 8c1fe1755..64084ecd1 100644 --- a/src/drunc/grpc_testing_tools/grpc_running_server_data.py +++ b/src/drunc/grpc_testing_tools/grpc_running_server_data.py @@ -1,4 +1,34 @@ -from typing import Any +from typing import Protocol + +from drunc.grpc_testing_tools.available_grpc_servers import ServerType + + +class TargetFunc(Protocol): + """Callable target used to launch a server process.""" + + def __call__(self, *args: object, **kwargs: object) -> object: ... + + +class ProcessLike(Protocol): + """Minimal process API required by connection managers.""" + + def start(self) -> object: ... + + def is_alive(self) -> bool: ... + + def terminate(self) -> object: ... + + def kill(self) -> object: ... + + def join(self, timeout: float | None = None) -> object: ... + + +class EventLike(Protocol): + """Minimal event API used for readiness/stop coordination.""" + + def set(self) -> object: ... + + def is_set(self) -> bool: ... class RunningGrpcServer: @@ -7,7 +37,13 @@ class RunningGrpcServer: The server could have been started via any supported method (multiprocessing, SSH, etc.) """ - def __init__(self, process_id: str, target_func: Any, args: tuple, kwargs: dict): + def __init__( + self, + process_id: str, + target_func: TargetFunc, + args: tuple[object, ...], + kwargs: dict[str, object], + ) -> None: """ Initialise process handle with execution parameters. @@ -21,15 +57,15 @@ def __init__(self, process_id: str, target_func: Any, args: tuple, kwargs: dict) self.target_func = target_func self.args = args self.kwargs = kwargs - self._process = None + self._process: ProcessLike | None = None self._started = False - self.startup_error = None - self.host = None - self.server_id = None - self.port = None - self.server_type = None - self.ready_event = None - self.stop_event = None + self.startup_error: Exception | None = None + self.host: str | None = None + self.server_id: str | None = None + self.port: int | None = None + self.server_type: str | ServerType | None = None + self.ready_event: EventLike | None = None + self.stop_event: EventLike | None = None def is_valid(self) -> bool: """Check if the process handle is valid""" @@ -48,11 +84,11 @@ def started(self) -> bool: return self._started @property - def process(self) -> Any: + def process(self) -> ProcessLike | None: """Get the underlying process object (implementation-specific).""" return self._process - def set_process(self, process: Any) -> None: + def set_process(self, process: ProcessLike) -> None: """Set the underlying process object.""" self._process = process @@ -61,7 +97,7 @@ def mark_started(self) -> None: self._started = True def set_server_info( - self, server_id: str, host: str, port: int, server_type: str + self, server_id: str, host: str, port: int, server_type: str | ServerType ) -> None: """Set the server information for this process.""" self.server_id = server_id diff --git a/src/drunc/grpc_testing_tools/grpc_server_config.py b/src/drunc/grpc_testing_tools/grpc_server_config.py index 2fab3ba22..8ac77930d 100644 --- a/src/drunc/grpc_testing_tools/grpc_server_config.py +++ b/src/drunc/grpc_testing_tools/grpc_server_config.py @@ -1,4 +1,4 @@ -from typing import Any, List, Tuple +from typing import List, Tuple from drunc.grpc_testing_tools.available_grpc_servers import ServerType @@ -19,10 +19,10 @@ def __init__( port: int, max_workers: int, log_file: str, - server_options: List[Tuple[str, Any]] = None, - client_options: List[Tuple[str, Any]] = None, - **kwargs, - ): + server_options: List[Tuple[str, object]] | None = None, + client_options: List[Tuple[str, object]] | None = None, + **kwargs: object, + ) -> None: """ Initialise gRPC server configuration. @@ -57,7 +57,7 @@ def __init__( required_params = [] # Store extra parameters and validate required ones are present - self.extra_params = {} + self.extra_params: dict[str, object] = {} for key, param in kwargs.items(): if key in required_params: self.extra_params[key] = param @@ -73,7 +73,7 @@ def __init__( f"Missing required parameter '{param}' for server type '{server_type}'" ) - def get_param(self, key: str, default: Any = None) -> Any: + def get_param(self, key: str, default: object = None) -> object: """ Get an additional parameter value. diff --git a/src/drunc/grpc_testing_tools/grpc_server_manager.py b/src/drunc/grpc_testing_tools/grpc_server_manager.py index 036fd5841..3b91801ab 100644 --- a/src/drunc/grpc_testing_tools/grpc_server_manager.py +++ b/src/drunc/grpc_testing_tools/grpc_server_manager.py @@ -7,7 +7,7 @@ """ import time -from typing import Dict, Optional +from typing import Dict, Optional, cast from grpc import ( FutureCancelledError, @@ -16,7 +16,10 @@ insecure_channel, ) -from drunc.grpc_testing_tools.grpc_running_server_data import RunningGrpcServer +from drunc.grpc_testing_tools.grpc_running_server_data import ( + RunningGrpcServer, + TargetFunc, +) from drunc.grpc_testing_tools.grpc_server_config import GrpcServerConfig from drunc.grpc_testing_tools.process_connection_manager import ( ProcessConnectionManager, @@ -75,7 +78,7 @@ def start_manager_server( # Create process handle with complete server function and arguments handle = self.connection_manager.create_process( config.server_id, - run_process_manager_server, + cast(TargetFunc, run_process_manager_server), config.max_workers, config.port, config.log_file, @@ -130,7 +133,7 @@ def start_root_controller_server( # Create process handle with complete server function and arguments handle = self.connection_manager.create_process( config.server_id, - run_root_controller_server, + cast(TargetFunc, run_root_controller_server), config.max_workers, config.port, manager_port, @@ -190,7 +193,7 @@ def start_child_controller_server( # Create process handle with complete server function and arguments handle = self.connection_manager.create_process( config.server_id, - run_child_controller_server, + cast(TargetFunc, run_child_controller_server), config.max_workers, config.port, root_port, diff --git a/src/drunc/grpc_testing_tools/multiprocessing_connection_manager.py b/src/drunc/grpc_testing_tools/multiprocessing_connection_manager.py index c27e769be..f82a27a33 100644 --- a/src/drunc/grpc_testing_tools/multiprocessing_connection_manager.py +++ b/src/drunc/grpc_testing_tools/multiprocessing_connection_manager.py @@ -8,8 +8,9 @@ import multiprocessing import os -from typing import Any, Dict, Optional +from typing import Dict, Optional, cast +from drunc.grpc_testing_tools.grpc_running_server_data import TargetFunc from drunc.grpc_testing_tools.process_connection_manager import ( ProcessConnectionManager, RunningGrpcServer, @@ -25,7 +26,7 @@ class MultiprocessingConnectionManager(ProcessConnectionManager): Creates and manages ready/stop events for process coordination. """ - def __init__(self, env_vars: Dict[str, str] = None): + def __init__(self, env_vars: Dict[str, str] | None = None) -> None: """ Initialise multiprocessing connection manager. @@ -35,7 +36,11 @@ def __init__(self, env_vars: Dict[str, str] = None): super().__init__(env_vars) def create_process( - self, process_id: str, target_func: Any, *args, **kwargs + self, + process_id: str, + target_func: TargetFunc, + *args: object, + **kwargs: object, ) -> RunningGrpcServer: """ Create a multiprocessing.Process handle with coordination events. @@ -55,11 +60,11 @@ def create_process( RunningGrpcServer containing the multiprocessing.Process and events """ # Create coordination events for this process - ready_event = multiprocessing.Event() - stop_event = multiprocessing.Event() + ready_event: multiprocessing.synchronize.Event = multiprocessing.Event() + stop_event: multiprocessing.synchronize.Event = multiprocessing.Event() # Wrap target function to set environment variables - def wrapped_target(*target_args, **target_kwargs): + def wrapped_target(*target_args: object, **target_kwargs: object) -> object: # Set environment variables in child process for key, value in self.env_vars.items(): os.environ[key] = value @@ -100,7 +105,10 @@ def start_process(self, handle: RunningGrpcServer) -> None: raise RuntimeError(f"Process {handle.process_id} is already started") try: - handle.process.start() + process = handle.process + if process is None: + raise RuntimeError(f"Process {handle.process_id} has not been created") + process.start() handle.mark_started() except Exception as e: raise RuntimeError(f"Failed to start process {handle.process_id}: {e}") @@ -123,7 +131,7 @@ def stop_process(self, handle: RunningGrpcServer, timeout: float = 10.0) -> None if not handle.started or not handle.process: return - process = handle.process + process = cast(multiprocessing.Process, handle.process) if not process.is_alive(): return @@ -154,7 +162,8 @@ def is_process_alive(self, handle: RunningGrpcServer) -> bool: if not handle.started or not handle.process: return False - return handle.process.is_alive() + process = cast(multiprocessing.Process, handle.process) + return process.is_alive() def wait_for_termination( self, handle: RunningGrpcServer, timeout: Optional[float] = None @@ -167,7 +176,8 @@ def wait_for_termination( timeout: Maximum time to wait """ if handle.started and handle.process: - handle.process.join(timeout=timeout) + process = cast(multiprocessing.Process, handle.process) + process.join(timeout=timeout) def cleanup(self) -> None: """Stop all managed processes and cleanup resources.""" diff --git a/src/drunc/grpc_testing_tools/process_connection_manager.py b/src/drunc/grpc_testing_tools/process_connection_manager.py index 48bd9a465..695f305a1 100644 --- a/src/drunc/grpc_testing_tools/process_connection_manager.py +++ b/src/drunc/grpc_testing_tools/process_connection_manager.py @@ -5,9 +5,12 @@ """ from abc import ABC, abstractmethod -from typing import Any, Dict, List, Optional +from typing import Dict, List, Optional -from drunc.grpc_testing_tools.grpc_running_server_data import RunningGrpcServer +from drunc.grpc_testing_tools.grpc_running_server_data import ( + RunningGrpcServer, + TargetFunc, +) class ProcessConnectionManager(ABC): @@ -18,7 +21,7 @@ class ProcessConnectionManager(ABC): follow, whether using local multiprocessing or remote SSH execution. """ - def __init__(self, env_vars: Dict[str, str] = None): + def __init__(self, env_vars: Dict[str, str] | None = None) -> None: """ Initialise process connection manager. @@ -30,7 +33,11 @@ def __init__(self, env_vars: Dict[str, str] = None): @abstractmethod def create_process( - self, process_id: str, target_func: Any, *args, **kwargs + self, + process_id: str, + target_func: TargetFunc, + *args: object, + **kwargs: object, ) -> RunningGrpcServer: """ Create a new process handle for execution. diff --git a/src/drunc/grpc_testing_tools/process_manager.py b/src/drunc/grpc_testing_tools/process_manager.py index f5cf7c12f..5db528f23 100644 --- a/src/drunc/grpc_testing_tools/process_manager.py +++ b/src/drunc/grpc_testing_tools/process_manager.py @@ -11,20 +11,12 @@ import signal import threading import time -from typing import Dict +from typing import Protocol, cast +import grpc from grpc import RpcError, StatusCode, insecure_channel -from drunc.grpc_testing_tools.test_services_pb2 import ( - BootRequest, - DummyResponse, - KillRequest, - KillResponse, - ProcessDescription, - ProcessInstance, - ProcessInstanceList, - ResponseFlag, -) +from drunc.grpc_testing_tools import test_services_pb2 as pb2 from drunc.grpc_testing_tools.test_services_pb2_grpc import ( ManagerServiceServicer, ManagerServiceStub, @@ -41,6 +33,57 @@ ) +class _SshManagerProtocol(Protocol): + def start_process(self, uuid: str, boot_request: object) -> object: ... + + def is_process_alive(self, uuid: str) -> bool: ... + + def kill_process(self, uuid: str) -> int | None: ... + + +class _ExecArgsProtocol(Protocol): + exec: str + args: list[str] + + +class _UuidProtocol(Protocol): + uuid: str + + +class _MetadataProtocol(Protocol): + uuid: _UuidProtocol + name: str + hostname: str + + +class _ProcessDescriptionProtocol(Protocol): + metadata: _MetadataProtocol + executable_and_arguments: list[_ExecArgsProtocol] + + +class _BootRequestProtocol(Protocol): + token: object + process_description: _ProcessDescriptionProtocol + process_restriction: object + + +class _Pb2ModuleProtocol(Protocol): + def DummyResponse(self, *args: object, **kwargs: object) -> object: ... + + def ProcessInstanceList(self, *args: object, **kwargs: object) -> object: ... + + def ResponseFlag(self, *args: object, **kwargs: object) -> object: ... + + def ProcessInstance(self, *args: object, **kwargs: object) -> object: ... + + def KillRequest(self, *args: object, **kwargs: object) -> object: ... + + def KillResponse(self, *args: object, **kwargs: object) -> object: ... + + +PB2 = cast(_Pb2ModuleProtocol, pb2) + + class ManagerServiceImpl(ManagerServiceServicer): """ Implementation of Manager gRPC service compatible with druncschema components. @@ -49,28 +92,37 @@ class ManagerServiceImpl(ManagerServiceServicer): SSHProcessLifetimeManager for SSH-based process execution. """ - def __init__(self, lifetime_manager_type=ProcessManagerTypes.SSH_SHELL): + def __init__( + self, + lifetime_manager_type: ProcessManagerTypes = ProcessManagerTypes.SSH_SHELL, + ) -> None: """Initialise the Manager service implementation.""" if lifetime_manager_type == ProcessManagerTypes.SSH_PARAMIKO: - self.ssh_manager = SSHProcessLifetimeManagerParamiko( - disable_host_key_check=True, - disable_localhost_host_key_check=True, - logger=logging.getLogger(__name__), + self.ssh_manager: _SshManagerProtocol = cast( + _SshManagerProtocol, + SSHProcessLifetimeManagerParamiko( # type: ignore[abstract] + disable_host_key_check=True, + disable_localhost_host_key_check=True, + logger=logging.getLogger(__name__), + ), ) elif lifetime_manager_type == ProcessManagerTypes.SSH_SHELL: - self.ssh_manager = SSHProcessLifetimeManagerShell( - disable_host_key_check=True, - disable_localhost_host_key_check=True, - logger=logging.getLogger(__name__), + self.ssh_manager = cast( + _SshManagerProtocol, + SSHProcessLifetimeManagerShell( + disable_host_key_check=True, + disable_localhost_host_key_check=True, + logger=logging.getLogger(__name__), + ), ) else: raise ValueError(f"Unknown lifetime_manager_type: {lifetime_manager_type}") # Track booted processes - self.booted_servers: Dict[str, Dict] = {} + self.booted_servers: dict[str, dict[str, object]] = {} self.boot_lock = threading.Lock() - def MakeRequest(self, request, context): + def MakeRequest(self, request: object, context: grpc.ServicerContext) -> object: """ Handle incoming connectivity test requests. @@ -81,9 +133,10 @@ def MakeRequest(self, request, context): Returns: DummyResponse with echoed message confirming Manager is responsive """ - return DummyResponse(reply=f"Manager server response: {request.message}") + message = getattr(request, "message", "") + return PB2.DummyResponse(reply=f"Manager server response: {message}") - def boot(self, request: BootRequest, context) -> ProcessInstanceList: + def boot(self, request: object, context: grpc.ServicerContext) -> object: """ Boot a new gRPC server process via SSH using BootRequest. @@ -95,16 +148,17 @@ def boot(self, request: BootRequest, context) -> ProcessInstanceList: ProcessInstanceList indicating success/failure and providing server details """ with self.boot_lock: - process_uuid = request.process_description.metadata.uuid.uuid - process_name = request.process_description.metadata.name + typed_request = cast(_BootRequestProtocol, request) + process_uuid = typed_request.process_description.metadata.uuid.uuid + process_name = typed_request.process_description.metadata.name # Validate process UUID is unique if process_uuid in self.booted_servers: - return ProcessInstanceList( + return PB2.ProcessInstanceList( name="boot_error", - token=request.token, + token=typed_request.token, values=[], - flag=ResponseFlag( + flag=PB2.ResponseFlag( success=False, message=f"Process UUID '{process_uuid}' already exists", ), @@ -112,54 +166,54 @@ def boot(self, request: BootRequest, context) -> ProcessInstanceList: try: # Extract connection details from process metadata - hostname = request.process_description.metadata.hostname + hostname = typed_request.process_description.metadata.hostname # Start process via SSH using start_process method self.ssh_manager.start_process( uuid=process_uuid, - boot_request=request, + boot_request=typed_request, ) # Store server info self.booted_servers[process_uuid] = { "request": request, "command": self._build_server_command_from_description( - request.process_description + typed_request.process_description ), } # Create successful process instance - process_instance = ProcessInstance( - process_description=request.process_description, - process_restriction=request.process_restriction, - status_code=ProcessInstance.StatusCode.RUNNING, + process_instance = PB2.ProcessInstance( + process_description=typed_request.process_description, + process_restriction=typed_request.process_restriction, + status_code=1, return_code=0, - uuid=request.process_description.metadata.uuid, + uuid=typed_request.process_description.metadata.uuid, ) - return ProcessInstanceList( + return PB2.ProcessInstanceList( name=process_name, - token=request.token, + token=typed_request.token, values=[process_instance], - flag=ResponseFlag( + flag=PB2.ResponseFlag( success=True, message=f"Successfully booted {process_name} on {hostname}", ), ) except Exception as e: - return ProcessInstanceList( + return PB2.ProcessInstanceList( name=process_name, - token=request.token, + token=typed_request.token, values=[], - flag=ResponseFlag( + flag=PB2.ResponseFlag( success=False, message=f"Boot failed: {str(e)}", ), ) def _build_server_command_from_description( - self, process_desc: ProcessDescription + self, process_desc: _ProcessDescriptionProtocol ) -> str: """ Build the command to execute from ProcessDescription. @@ -209,20 +263,25 @@ def _kill_booted_server_via_grpc( # Create appropriate stub based on server type if server_type == "MANAGER": - stub = ManagerServiceStub(channel) + kill_response = ManagerServiceStub(channel).Kill( + PB2.KillRequest( + reason="Killed by Manager during shutdown", + grace_period_seconds=grace_period, + ), + timeout=5.0, + ) elif server_type == "ROOT_CONTROLLER" or server_type == "RootController": - stub = RootControllerServiceStub(channel) + kill_response = RootControllerServiceStub(channel).Kill( + PB2.KillRequest( + reason="Killed by Manager during shutdown", + grace_period_seconds=grace_period, + ), + timeout=5.0, + ) else: channel.close() return False, f"Unknown server type: {server_type}" - # Send Kill request - kill_request = KillRequest( - reason="Killed by Manager during shutdown", - grace_period_seconds=grace_period, - ) - - kill_response = stub.Kill(kill_request, timeout=5.0) channel.close() if kill_response.shutdown_initiated: @@ -244,7 +303,7 @@ def _kill_booted_server_via_grpc( except Exception as e: return False, f"Error sending Kill request: {str(e)}" - def Kill(self, request: KillRequest, context) -> KillResponse: + def Kill(self, request: object, context: grpc.ServicerContext) -> object: """ Handle graceful shutdown requests for the Manager service. @@ -259,12 +318,12 @@ def Kill(self, request: KillRequest, context) -> KillResponse: KillResponse indicating shutdown status """ grace_period = ( - max(request.grace_period_seconds, 1) - if request.grace_period_seconds > 0 + max(getattr(request, "grace_period_seconds", 0), 1) + if getattr(request, "grace_period_seconds", 0) > 0 else 2 ) - reason = request.reason or "No reason provided" + reason = getattr(request, "reason", None) or "No reason provided" # Kill all booted servers first kill_failures = [] @@ -276,7 +335,9 @@ def Kill(self, request: KillRequest, context) -> KillResponse: for process_uuid, server_info in list(self.booted_servers.items()): try: - boot_request = server_info["request"] + boot_request = cast( + _BootRequestProtocol, server_info["request"] + ) process_desc = boot_request.process_description print(f"Stopping booted server: {process_uuid}") @@ -349,7 +410,7 @@ def Kill(self, request: KillRequest, context) -> KillResponse: f"Manager Kill incomplete - failed to terminate {len(kill_failures)} " f"booted server(s): {failure_details}" ) - return KillResponse(shutdown_initiated=False, message=response_message) + return PB2.KillResponse(shutdown_initiated=False, message=response_message) # All children terminated successfully, now shutdown Manager booted_count = len(self.booted_servers) if self.booted_servers else 0 @@ -364,7 +425,7 @@ def Kill(self, request: KillRequest, context) -> KillResponse: "Shutdown thread starting...", ] - def delayed_shutdown(): + def delayed_shutdown() -> None: """Send SIGTERM to this process after a brief delay.""" time.sleep(0.5) # Allow response to be sent os.kill(os.getpid(), signal.SIGTERM) @@ -374,11 +435,11 @@ def delayed_shutdown(): shutdown_thread.daemon = True shutdown_thread.start() - return KillResponse( + return PB2.KillResponse( shutdown_initiated=True, message=" | ".join(response_details) ) - def _extract_port_from_args(self, process_desc: ProcessDescription) -> int: + def _extract_port_from_args(self, process_desc: _ProcessDescriptionProtocol) -> int: """ Extract port number from process arguments. diff --git a/src/drunc/grpc_testing_tools/process_manager_server_cli.py b/src/drunc/grpc_testing_tools/process_manager_server_cli.py index a062e6a02..176423d03 100644 --- a/src/drunc/grpc_testing_tools/process_manager_server_cli.py +++ b/src/drunc/grpc_testing_tools/process_manager_server_cli.py @@ -11,7 +11,7 @@ from drunc.grpc_testing_tools.run_grpc_services import run_process_manager_server -def main(): +def main() -> None: """ Main entry point for Manager server CLI. diff --git a/src/drunc/grpc_testing_tools/root_controller.py b/src/drunc/grpc_testing_tools/root_controller.py index b0608c07a..99f416002 100644 --- a/src/drunc/grpc_testing_tools/root_controller.py +++ b/src/drunc/grpc_testing_tools/root_controller.py @@ -9,17 +9,25 @@ import os import signal import threading +from typing import Protocol, cast -from drunc.grpc_testing_tools.test_services_pb2 import ( - DummyResponse, - KillRequest, - KillResponse, -) +import grpc + +from drunc.grpc_testing_tools import test_services_pb2 as pb2 from drunc.grpc_testing_tools.test_services_pb2_grpc import ( RootControllerServiceServicer, ) +class _Pb2ModuleProtocol(Protocol): + def DummyResponse(self, *args: object, **kwargs: object) -> object: ... + + def KillResponse(self, *args: object, **kwargs: object) -> object: ... + + +PB2 = cast(_Pb2ModuleProtocol, pb2) + + class RootControllerServiceImpl(RootControllerServiceServicer): """ Implementation of RootController gRPC service. @@ -29,11 +37,11 @@ class RootControllerServiceImpl(RootControllerServiceServicer): command processing, status collection, and graceful shutdown requests. """ - def __init__(self): + def __init__(self) -> None: """Initialise the RootController service implementation.""" pass - def MakeRequest(self, request, context): + def MakeRequest(self, request: object, context: grpc.ServicerContext) -> object: """ Handle incoming connectivity test requests. @@ -44,17 +52,18 @@ def MakeRequest(self, request, context): Returns: DummyResponse with echoed message confirming RootController is responsive """ - return DummyResponse(reply=f"RootController server response: {request.message}") + message = getattr(request, "message", "") + return PB2.DummyResponse(reply=f"RootController server response: {message}") - def Kill(self, request: KillRequest, context) -> KillResponse: + def Kill(self, request: object, context: grpc.ServicerContext) -> object: grace_period = ( - max(request.grace_period_seconds, 1) - if request.grace_period_seconds > 0 + max(getattr(request, "grace_period_seconds", 0), 1) + if getattr(request, "grace_period_seconds", 0) > 0 else 2 ) # Build detailed response message - reason = request.reason or "No reason provided" + reason = getattr(request, "reason", None) or "No reason provided" response_details = [ "Manager Kill method executed successfully", f"Reason: {reason}", @@ -63,7 +72,7 @@ def Kill(self, request: KillRequest, context) -> KillResponse: "Shutdown thread starting...", ] - def delayed_shutdown(): + def delayed_shutdown() -> None: """Send SIGTERM to this process after a brief delay.""" import time @@ -75,6 +84,6 @@ def delayed_shutdown(): shutdown_thread.daemon = True shutdown_thread.start() - return KillResponse( + return PB2.KillResponse( shutdown_initiated=True, message=" | ".join(response_details) ) diff --git a/src/drunc/grpc_testing_tools/root_controller_server_cli.py b/src/drunc/grpc_testing_tools/root_controller_server_cli.py index b4934e034..2afa30a3b 100644 --- a/src/drunc/grpc_testing_tools/root_controller_server_cli.py +++ b/src/drunc/grpc_testing_tools/root_controller_server_cli.py @@ -12,7 +12,7 @@ from drunc.grpc_testing_tools.run_grpc_services import run_root_controller_server -def main(): +def main() -> None: """ Main entry point for RootController server CLI. diff --git a/src/drunc/grpc_testing_tools/run_grpc_services.py b/src/drunc/grpc_testing_tools/run_grpc_services.py index fdf3734ce..c6bc371c2 100644 --- a/src/drunc/grpc_testing_tools/run_grpc_services.py +++ b/src/drunc/grpc_testing_tools/run_grpc_services.py @@ -1,7 +1,7 @@ import signal import time from concurrent import futures -from typing import Any, Dict, List, Optional, Tuple +from typing import List, Optional, Protocol, Tuple, cast from drunc.grpc_testing_tools.grpc_log_util import ( stderr_observer, @@ -9,20 +9,35 @@ ) from drunc.process_manager.configuration import ProcessManagerTypes + +class _GrpcServerProtocol(Protocol): + def add_insecure_port(self, addr: str) -> int: ... + + +class _GrpcServicerAddFunc(Protocol): + def __call__(self, servicer: object, server: _GrpcServerProtocol) -> object: ... + + +class _EventLike(Protocol): + def set(self) -> object: ... + + def is_set(self) -> bool: ... + + SERVER_GRACE_PERIOD = 2 def run_grpc_server( server_name: str, - servicer_instance: Any, - add_servicer_func: Any, + servicer_instance: object, + add_servicer_func: _GrpcServicerAddFunc, max_workers: int, server_port: int, log_file: str, - server_options: Optional[List[Tuple[str, Any]]] = None, - upstream_connection: Optional[Dict[str, Any]] = None, - ready_event=None, - stop_event=None, + server_options: Optional[List[Tuple[str, object]]] = None, + upstream_connection: Optional[dict[str, object]] = None, + ready_event: _EventLike | None = None, + stop_event: _EventLike | None = None, ) -> None: """Generic gRPC server runner that handles the common server lifecycle.""" @@ -34,7 +49,7 @@ def run_grpc_server( shutdown_requested = False - def signal_handler(signum: int, frame) -> None: + def signal_handler(signum: int, frame: object) -> None: """Handle SIGTERM and SIGINT for graceful server shutdown.""" nonlocal shutdown_requested shutdown_requested = True @@ -58,9 +73,11 @@ def signal_handler(signum: int, frame) -> None: server.start() if upstream_connection: - upstream_host = upstream_connection["host"] - upstream_port = upstream_connection["port"] - client_options = upstream_connection.get("options", []) + upstream_host = str(upstream_connection["host"]) + upstream_port = cast(int, upstream_connection["port"]) + client_options = cast( + list[tuple[str, object]], upstream_connection.get("options", []) + ) upstream_channel = insecure_channel( f"{upstream_host}:{upstream_port}", options=client_options @@ -94,9 +111,9 @@ def run_process_manager_server( manager_max_workers: int, server_port: int, log_file: str, - server_options: Optional[List[Tuple[str, Any]]] = None, - ready_event=None, - stop_event=None, + server_options: Optional[List[Tuple[str, object]]] = None, + ready_event: _EventLike | None = None, + stop_event: _EventLike | None = None, lifetime_manager_type: ProcessManagerTypes = ProcessManagerTypes.SSH_SHELL, ) -> None: """Run Manager server process with output logging.""" @@ -126,10 +143,10 @@ def run_root_controller_server( server_port: int, manager_port: int, log_file: str, - server_options: Optional[List[Tuple[str, Any]]] = None, - client_options: Optional[List[Tuple[str, Any]]] = None, - ready_event=None, - stop_event=None, + server_options: Optional[List[Tuple[str, object]]] = None, + client_options: Optional[List[Tuple[str, object]]] = None, + ready_event: _EventLike | None = None, + stop_event: _EventLike | None = None, ) -> None: """Run RootController server with Manager client connection.""" from drunc.grpc_testing_tools.root_controller import RootControllerServiceImpl @@ -161,10 +178,10 @@ def run_child_controller_server( root_port: int, child_name: str, log_file: str, - server_options: Optional[List[Tuple[str, Any]]] = None, - client_options: Optional[List[Tuple[str, Any]]] = None, - ready_event=None, - stop_event=None, + server_options: Optional[List[Tuple[str, object]]] = None, + client_options: Optional[List[Tuple[str, object]]] = None, + ready_event: _EventLike | None = None, + stop_event: _EventLike | None = None, ) -> None: """Run ChildController server with RootController client connection.""" from drunc.grpc_testing_tools.child_controller import ( diff --git a/src/drunc/utils/configuration.py b/src/drunc/utils/configuration.py index 9fb5b2199..6bbf00426 100644 --- a/src/drunc/utils/configuration.py +++ b/src/drunc/utils/configuration.py @@ -4,7 +4,7 @@ import logging import os from enum import Enum -from typing import cast +from typing import Protocol, cast import conffwk @@ -26,6 +26,10 @@ class ConfTypes(Enum): OKSFileName = 4 +class _OksDbProtocol(Protocol): + def get_dal(self, class_name: str, uid: str) -> object: ... + + def CLI_to_ConfTypes(scheme: str) -> ConfTypes: """Convert a CLI scheme string to a ConfTypes enum. @@ -244,7 +248,7 @@ def _parse_oks_file(self, oks_path: str) -> object: self.log.debug(f"Using {self.oks_path} to configure") self.db = conffwk.Configuration(self.oks_path) assert self.oks_key is not None, "OKS key is required for OKS configuration" - return self.db.get_dal( + return cast(_OksDbProtocol, self.db).get_dal( class_name=self.oks_key.class_name, uid=self.oks_key.obj_uid ) diff --git a/src/drunc/utils/grpc_utils.py b/src/drunc/utils/grpc_utils.py index 3eec5ef73..37636f85a 100644 --- a/src/drunc/utils/grpc_utils.py +++ b/src/drunc/utils/grpc_utils.py @@ -13,7 +13,7 @@ from google.protobuf.descriptor import FieldDescriptor from google.protobuf.message import Message from google.rpc import code_pb2, error_details_pb2, status_pb2 -from grpc_status import rpc_status # type: ignore[import-untyped] +from grpc_status import rpc_status from drunc.exceptions import ( DruncCommandException, @@ -74,7 +74,7 @@ def pack_to_any(data: Message) -> any_pb2.Any: return any -T = TypeVar("T") +T = TypeVar("T", bound=Message) def unpack_any(data: any_pb2.Any, format: type[T]) -> T: @@ -90,9 +90,9 @@ def unpack_any(data: any_pb2.Any, format: type[T]) -> T: Raises: UnpackingError: If the message cannot be unpacked into the specified format. """ - if not data.Is(format.DESCRIPTOR): - raise UnpackingError(data, format) req = format() + if not data.Is(req.DESCRIPTOR): + raise UnpackingError(data, type(req)) data.Unpack(req) return req diff --git a/src/drunc/utils/shell_utils.py b/src/drunc/utils/shell_utils.py index 72062f228..50210e44a 100644 --- a/src/drunc/utils/shell_utils.py +++ b/src/drunc/utils/shell_utils.py @@ -202,7 +202,7 @@ class ShellContext: None # used for logging if its a PM shell or Unified shell etc ) - def get_shell_id(self): + def get_shell_id(self) -> str | None: return self.shell_id def _reset( @@ -430,7 +430,7 @@ def print_status_summary(self) -> None: ) -def log_pm_cmd(obj: ShellContext): +def log_pm_cmd(obj: ShellContext) -> None: """Log a process-manager shell command with only explicitly provided arguments. The current Click command context is inspected and only parameters whose source is diff --git a/src/drunc/utils/utils.py b/src/drunc/utils/utils.py index d24711b2c..9d646edeb 100644 --- a/src/drunc/utils/utils.py +++ b/src/drunc/utils/utils.py @@ -367,7 +367,7 @@ def parent_death_pact(signal: int = signal.SIGHUP) -> None: # 777 PERMISSIONS ARE COMPLETELY TEMPORARY # An established procedure for multi users will need to be discussed with sysadmins # will be removed when done -def touch_and_chmod(filepath: str, mode=0o777): +def touch_and_chmod(filepath: str, mode: int = 0o777) -> None: """Makes and sets the permissions of a file. This is used to ensure multiuser support when accessing files etc."""