Skip to content

Commit

Permalink
Add explicit return for mypy
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
  • Loading branch information
alinabuzachis committed Sep 16, 2024
1 parent 8c9295f commit 16caa40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/modules/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@


import yaml
from typing import Any, Dict, List, NoReturn, Optional, Union
from typing import Any, Dict, List, Union

from ansible.module_utils.basic import AnsibleModule

Expand All @@ -196,7 +196,7 @@
from ..module_utils.errors import EDAError


def find_matching_source(event: Dict[str, Any], sources: List[Dict[str, Any]], module: AnsibleModule) -> Union[Dict[str, Any], NoReturn]:
def find_matching_source(event: Dict[str, Any], sources: List[Dict[str, Any]], module: AnsibleModule) -> Dict[str, Any]:
"""
Finds a matching source based on the source_name in the event.
Raises an error if no match is found.
Expand All @@ -214,6 +214,8 @@ def find_matching_source(event: Dict[str, Any], sources: List[Dict[str, Any]], m
msg=f"The specified source_name {source_name} does not exist."
)

return {} # Explicit return to satisfy mypy


def process_event_streams(
rulebook_id: int,
Expand All @@ -229,7 +231,7 @@ def process_event_streams(
module: The module object, typically for error handling.
Returns:
List of source mappings.
List source mappings.
"""

source_mappings = []
Expand Down

0 comments on commit 16caa40

Please sign in to comment.