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 f14903d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .config/manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ plugins/modules/event_stream.py
plugins/modules/event_stream_info.py
plugins/modules/project.py
plugins/modules/project_info.py
plugins/modules/rulebook_info.py
plugins/modules/user.py
plugins/modules/__init__.py
plugins/module_utils/
Expand Down
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 f14903d

Please sign in to comment.