From a02d261fe32fa45cc0d82484594ee61931ee358d Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Sun, 23 Apr 2023 10:21:14 +0200 Subject: [PATCH] updated the docify function --- plugins/module_utils/module.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/module.py b/plugins/module_utils/module.py index d890f82..9f2a10f 100644 --- a/plugins/module_utils/module.py +++ b/plugins/module_utils/module.py @@ -5,9 +5,9 @@ from typing import Any, Callable, ClassVar, Dict, NoReturn, Optional, Type, Type import ansible.module_utils.basic as basic try: - from ansible_collections.sebastian.systemd.plugins.module_utils.generic import Types, _sdict + from ansible_collections.sebastian.systemd.plugins.module_utils.generic import AnsibleParameter, Types except ImportError: - from plugins.module_utils.generic import Types, _sdict + from plugins.module_utils.generic import AnsibleParameter, Types __all__ = ( @@ -21,12 +21,10 @@ __all__ = ( T = TypeVar("T") -def docify(input: Union[dict, _sdict]) -> dict: +def docify(input: Union[dict, AnsibleParameter]) -> dict: options = dict() for name, help in input.items(): options[name] = dict(type=help["type"]) - if hasattr(help, "_help") and help._help is not None: - options[name]["description"] = help._help if "description" in help and isinstance(help["description"], str): options[name]["description"] = options[name]["description"].split("\n") if "required" in help and help["required"]: