ez_docker/plugins/module_utils/label/common.py
2025-01-17 18:31:17 +01:00

24 lines
690 B
Python

# Copyright: (c) 2025, Luca Bilke <luca@bil.ke>
# MIT License (see LICENSE)
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Callable
from ansible_collections.snailed.ez_compose.plugins.module_utils.service import common
if TYPE_CHECKING:
from ansible_collections.snailed.ez_compose.plugins.module_utils.models import State
BASE_ARGS: dict[str, Any] = {}
def run_helper(
state: State,
service_name: str,
params: dict[str, Any],
helper: Callable[[State, str, dict[str, Any]], dict[str, Any]] = lambda _a, _b, _c: {},
) -> State:
update = helper(state, service_name, params)
return common.apply_update(state, service_name, update)