mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Add typing information, 2/n (#1178)
* Add typing to Docker Stack modules. Clean modules up. * Add typing to Docker Swarm modules. * Add typing to unit tests. * Add more typing. * Add ignore.txt entries.
This commit is contained in:
@@ -63,6 +63,7 @@ service:
|
||||
"""
|
||||
|
||||
import traceback
|
||||
import typing as t
|
||||
|
||||
|
||||
try:
|
||||
@@ -79,12 +80,12 @@ from ansible_collections.community.docker.plugins.module_utils._swarm import (
|
||||
)
|
||||
|
||||
|
||||
def get_service_info(client):
|
||||
def get_service_info(client: AnsibleDockerSwarmClient) -> dict[str, t.Any] | None:
|
||||
service = client.module.params["name"]
|
||||
return client.get_service_inspect(service_id=service, skip_missing=True)
|
||||
|
||||
|
||||
def main():
|
||||
def main() -> None:
|
||||
argument_spec = {
|
||||
"name": {"type": "str", "required": True},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user