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:
parent
91ef50cef7
commit
125dc6f5e2
3 changed files with 35 additions and 33 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue