mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-03 23:41:51 +00:00
Cleanup (#11445)
* Correctly position BOTMETA entry. * Standardize to 'import typing as t'. * Remove platform attribute.
This commit is contained in:
parent
7a18af80ce
commit
f933465658
3 changed files with 10 additions and 14 deletions
4
.github/BOTMETA.yml
vendored
4
.github/BOTMETA.yml
vendored
|
|
@ -1337,6 +1337,8 @@ files:
|
||||||
maintainers: farhan7500 gautamphegde
|
maintainers: farhan7500 gautamphegde
|
||||||
$modules/ssh_config.py:
|
$modules/ssh_config.py:
|
||||||
maintainers: gaqzi Akasurde
|
maintainers: gaqzi Akasurde
|
||||||
|
$modules/sssd_info.py:
|
||||||
|
maintainers: a-gabidullin
|
||||||
$modules/stacki_host.py:
|
$modules/stacki_host.py:
|
||||||
labels: stacki_host
|
labels: stacki_host
|
||||||
maintainers: bsanders bbyhuy
|
maintainers: bsanders bbyhuy
|
||||||
|
|
@ -1510,8 +1512,6 @@ files:
|
||||||
maintainers: vbotka
|
maintainers: vbotka
|
||||||
$tests/fqdn_valid.py:
|
$tests/fqdn_valid.py:
|
||||||
maintainers: vbotka
|
maintainers: vbotka
|
||||||
$modules/sssd_info.py:
|
|
||||||
maintainers: a-gabidullin
|
|
||||||
#########################
|
#########################
|
||||||
docs/docsite/rst/filter_guide.rst: {}
|
docs/docsite/rst/filter_guide.rst: {}
|
||||||
docs/docsite/rst/filter_guide_abstract_informations.rst: {}
|
docs/docsite/rst/filter_guide_abstract_informations.rst: {}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ from ansible.errors import AnsibleFilterError
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
JSONPATCH_IMPORT_ERROR: ImportError | None
|
JSONPATCH_IMPORT_ERROR: ImportError | None
|
||||||
try:
|
try:
|
||||||
|
|
@ -31,7 +30,7 @@ OPERATIONS_NEEDING_VALUE = ["add", "replace", "test"]
|
||||||
class FilterModule:
|
class FilterModule:
|
||||||
"""Filter plugin."""
|
"""Filter plugin."""
|
||||||
|
|
||||||
def check_json_object(self, filter_name: str, object_name: str, inp: Any):
|
def check_json_object(self, filter_name: str, object_name: str, inp: t.Any):
|
||||||
if isinstance(inp, (str, bytes, bytearray)):
|
if isinstance(inp, (str, bytes, bytearray)):
|
||||||
try:
|
try:
|
||||||
return loads(inp)
|
return loads(inp)
|
||||||
|
|
@ -64,9 +63,9 @@ class FilterModule:
|
||||||
inp: str | list | dict | bytes | bytearray,
|
inp: str | list | dict | bytes | bytearray,
|
||||||
op: str,
|
op: str,
|
||||||
path: str,
|
path: str,
|
||||||
value: Any = None,
|
value: t.Any = None,
|
||||||
**kwargs: dict,
|
**kwargs: dict,
|
||||||
) -> Any:
|
) -> t.Any:
|
||||||
if not HAS_LIB:
|
if not HAS_LIB:
|
||||||
raise AnsibleFilterError(
|
raise AnsibleFilterError(
|
||||||
"You need to install 'jsonpatch' package prior to running 'json_patch' filter"
|
"You need to install 'jsonpatch' package prior to running 'json_patch' filter"
|
||||||
|
|
@ -110,7 +109,7 @@ class FilterModule:
|
||||||
operations: list,
|
operations: list,
|
||||||
/,
|
/,
|
||||||
fail_test: bool = False,
|
fail_test: bool = False,
|
||||||
) -> Any:
|
) -> t.Any:
|
||||||
if not HAS_LIB:
|
if not HAS_LIB:
|
||||||
raise AnsibleFilterError(
|
raise AnsibleFilterError(
|
||||||
"You need to install 'jsonpatch' package prior to running 'json_patch_recipe' filter"
|
"You need to install 'jsonpatch' package prior to running 'json_patch_recipe' filter"
|
||||||
|
|
@ -160,7 +159,7 @@ class FilterModule:
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def filters(self) -> dict[str, Callable[..., Any]]:
|
def filters(self) -> dict[str, Callable[..., t.Any]]:
|
||||||
"""Map filter plugin names to their functions.
|
"""Map filter plugin names to their functions.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,12 @@ description:
|
||||||
author: "Aleksandr Gabidullin (@a-gabidullin)"
|
author: "Aleksandr Gabidullin (@a-gabidullin)"
|
||||||
requirements:
|
requirements:
|
||||||
- dbus
|
- dbus
|
||||||
|
- SSSD needs to be running
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: full
|
support: full
|
||||||
diff_mode:
|
diff_mode:
|
||||||
support: none
|
support: none
|
||||||
platform:
|
|
||||||
platforms: posix
|
|
||||||
description: This action requires a system with D-Bus and SSSD running.
|
|
||||||
support: full
|
|
||||||
options:
|
options:
|
||||||
action:
|
action:
|
||||||
description:
|
description:
|
||||||
|
|
@ -104,7 +101,7 @@ list_servers:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from typing import Any
|
import typing as t
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
@ -218,7 +215,7 @@ def main() -> None:
|
||||||
server_type = module.params.get("server_type")
|
server_type = module.params.get("server_type")
|
||||||
|
|
||||||
sssd = SSSDHandler()
|
sssd = SSSDHandler()
|
||||||
result: dict[str, Any] = {}
|
result: dict[str, t.Any] = {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if action == "domain_status":
|
if action == "domain_status":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue