1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

refactor: add future annotations imports (#398)

##### SUMMARY

This adds future annotations imports to benefit from the modern python
typing system.
This commit is contained in:
Jonas L 2023-11-23 14:53:10 +01:00 committed by GitHub
parent 9905bd0e01
commit df8c3b6a59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 275 additions and 126 deletions

View file

@ -4,6 +4,8 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
DOCUMENTATION = """
---
module: ssh_key_info
@ -75,7 +77,6 @@ hcloud_ssh_key_info:
returned: always
type: dict
"""
from typing import List, Optional
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native
@ -88,7 +89,7 @@ from ..module_utils.vendor.hcloud.ssh_keys import BoundSSHKey
class AnsibleHCloudSSHKeyInfo(AnsibleHCloud):
represent = "hcloud_ssh_key_info"
hcloud_ssh_key_info: Optional[List[BoundSSHKey]] = None
hcloud_ssh_key_info: list[BoundSSHKey] | None = None
def _prepare_result(self):
ssh_keys = []
@ -134,7 +135,7 @@ class AnsibleHCloudSSHKeyInfo(AnsibleHCloud):
name={"type": "str"},
fingerprint={"type": "str"},
label_selector={"type": "str"},
**super().base_module_arguments()
**super().base_module_arguments(),
),
supports_check_mode=True,
)