1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-15 12:27:38 +00:00

move common argument specs to shared module_utils

This commit is contained in:
shreyash bhosale 2026-06-08 16:50:31 +05:30
parent 91ef50cef7
commit 125dc6f5e2
3 changed files with 35 additions and 33 deletions

View file

@ -29,6 +29,19 @@ with deps.declare("lxml"):
from lxml import etree # type: ignore[no-redef]
COMMON_ARGUMENT_SPEC = dict(
path=dict(type="path", aliases=["dest", "file"]),
xmlstring=dict(type="str"),
xpath=dict(type="str"),
namespaces=dict(type="dict", default={}),
count=dict(type="bool", default=False),
print_match=dict(type="bool", default=False),
content=dict(type="str", choices=["attribute", "text"]),
strip_cdata_tags=dict(type="bool", default=False),
huge_tree=dict(type="bool", default=False),
)
def check_lxml(module: AnsibleModule) -> None:
deps.validate(module, "lxml")
version_str = ".".join(str(f) for f in etree.LXML_VERSION)