1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-02 10:26:22 +00:00

[PR #11283/ef632145 backport][stable-12] Add more module_utils typing (#11289)

Add more module_utils typing (#11283)

Add more module_utils typing.

(cherry picked from commit ef632145e9)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-12-17 21:24:55 +01:00 committed by GitHub
parent 8590184232
commit 21aa086ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 340 additions and 274 deletions

View file

@ -4,11 +4,12 @@
from __future__ import annotations
import typing as t
from ansible.module_utils import basic
def convert_to_binary_multiple(size_with_unit):
def convert_to_binary_multiple(size_with_unit: str | None) -> int:
if size_with_unit is None:
return -1
valid_units = ["MiB", "GiB", "TiB"]
@ -35,7 +36,7 @@ storage_system_spec = {
}
def cpg_argument_spec():
def cpg_argument_spec() -> dict[str, t.Any]:
spec = {
"state": {"required": True, "choices": ["present", "absent"], "type": "str"},
"cpg_name": {"required": True, "type": "str"},