Skip to content

Commit 250230e

Browse files
authored
Avoid deprecated typing.Callable. (#959)
1 parent bd5f3b4 commit 250230e

File tree

15 files changed

+39
-28
lines changed

15 files changed

+39
-28
lines changed

plugins/filter/gpg_fingerprint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
type: string
4040
"""
4141

42-
import typing as t
42+
from collections.abc import Callable
4343

4444
from ansible.errors import AnsibleFilterError
4545
from ansible.module_utils.common.text.converters import to_bytes
@@ -70,7 +70,7 @@ def gpg_fingerprint(gpg_key_content: str | bytes) -> str:
7070
class FilterModule:
7171
"""Ansible jinja2 filters"""
7272

73-
def filters(self) -> dict[str, t.Callable]:
73+
def filters(self) -> dict[str, Callable]:
7474
return {
7575
"gpg_fingerprint": gpg_fingerprint,
7676
}

plugins/filter/openssl_csr_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
"""
276276

277277
import typing as t
278+
from collections.abc import Callable
278279

279280
from ansible.errors import AnsibleFilterError
280281
from ansible.module_utils.common.text.converters import to_bytes, to_text
@@ -322,7 +323,7 @@ def openssl_csr_info_filter(
322323
class FilterModule:
323324
"""Ansible jinja2 filters"""
324325

325-
def filters(self) -> dict[str, t.Callable]:
326+
def filters(self) -> dict[str, Callable]:
326327
return {
327328
"openssl_csr_info": openssl_csr_info_filter,
328329
}

plugins/filter/openssl_privatekey_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
"""
148148

149149
import typing as t
150+
from collections.abc import Callable
150151

151152
from ansible.errors import AnsibleFilterError
152153
from ansible.module_utils.common.text.converters import to_bytes, to_text
@@ -202,7 +203,7 @@ def openssl_privatekey_info_filter(
202203
class FilterModule:
203204
"""Ansible jinja2 filters"""
204205

205-
def filters(self) -> dict[str, t.Callable]:
206+
def filters(self) -> dict[str, Callable]:
206207
return {
207208
"openssl_privatekey_info": openssl_privatekey_info_filter,
208209
}

plugins/filter/openssl_publickey_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
"""
125125

126126
import typing as t
127+
from collections.abc import Callable
127128

128129
from ansible.errors import AnsibleFilterError
129130
from ansible.module_utils.common.text.converters import to_bytes
@@ -159,7 +160,7 @@ def openssl_publickey_info_filter(data: str | bytes) -> dict[str, t.Any]:
159160
class FilterModule:
160161
"""Ansible jinja2 filters"""
161162

162-
def filters(self) -> dict[str, t.Callable]:
163+
def filters(self) -> dict[str, Callable]:
163164
return {
164165
"openssl_publickey_info": openssl_publickey_info_filter,
165166
}

plugins/filter/parse_serial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
type: int
4040
"""
4141

42-
import typing as t
42+
from collections.abc import Callable
4343

4444
from ansible.errors import AnsibleFilterError
4545
from ansible.module_utils.common.text.converters import to_text
@@ -63,7 +63,7 @@ def parse_serial_filter(serial_str: str | bytes) -> int:
6363
class FilterModule:
6464
"""Ansible jinja2 filters"""
6565

66-
def filters(self) -> dict[str, t.Callable]:
66+
def filters(self) -> dict[str, Callable]:
6767
return {
6868
"parse_serial": parse_serial_filter,
6969
}

plugins/filter/split_pem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
elements: string
3939
"""
4040

41-
import typing as t
41+
from collections.abc import Callable
4242

4343
from ansible.errors import AnsibleFilterError
4444
from ansible.module_utils.common.text.converters import to_text
@@ -61,7 +61,7 @@ def split_pem_filter(data: str | bytes) -> list[str]:
6161
class FilterModule:
6262
"""Ansible jinja2 filters"""
6363

64-
def filters(self) -> dict[str, t.Callable]:
64+
def filters(self) -> dict[str, Callable]:
6565
return {
6666
"split_pem": split_pem_filter,
6767
}

plugins/filter/to_serial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
type: string
4040
"""
4141

42-
import typing as t
42+
from collections.abc import Callable
4343

4444
from ansible.errors import AnsibleFilterError
4545

@@ -64,7 +64,7 @@ def to_serial_filter(serial_int: int) -> str:
6464
class FilterModule:
6565
"""Ansible jinja2 filters"""
6666

67-
def filters(self) -> dict[str, t.Callable]:
67+
def filters(self) -> dict[str, Callable]:
6868
return {
6969
"to_serial": to_serial_filter,
7070
}

plugins/filter/x509_certificate_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@
309309
"""
310310

311311
import typing as t
312+
from collections.abc import Callable
312313

313314
from ansible.errors import AnsibleFilterError
314315
from ansible.module_utils.common.text.converters import to_bytes, to_text
@@ -354,7 +355,7 @@ def x509_certificate_info_filter(
354355
class FilterModule:
355356
"""Ansible jinja2 filters"""
356357

357-
def filters(self) -> dict[str, t.Callable]:
358+
def filters(self) -> dict[str, Callable]:
358359
return {
359360
"x509_certificate_info": x509_certificate_info_filter,
360361
}

plugins/filter/x509_crl_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
import base64
157157
import binascii
158158
import typing as t
159+
from collections.abc import Callable
159160

160161
from ansible.errors import AnsibleFilterError
161162
from ansible.module_utils.common.text.converters import to_bytes, to_text
@@ -221,7 +222,7 @@ def x509_crl_info_filter(
221222
class FilterModule:
222223
"""Ansible jinja2 filters"""
223224

224-
def filters(self) -> dict[str, t.Callable]:
225+
def filters(self) -> dict[str, Callable]:
225226
return {
226227
"x509_crl_info": x509_crl_info_filter,
227228
}

plugins/module_utils/_acme/certificate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import os
1111
import typing as t
12+
from collections.abc import Callable
1213

1314
from ansible_collections.community.crypto.plugins.module_utils._acme.account import (
1415
ACMEAccount,
@@ -213,7 +214,7 @@ def call_validate(
213214
self,
214215
pending_authzs: list[Authorization],
215216
*,
216-
get_challenge: t.Callable[[Authorization], str],
217+
get_challenge: Callable[[Authorization], str],
217218
wait: bool = True,
218219
) -> list[tuple[Authorization, str, Challenge | None]]:
219220
authzs_with_challenges_to_wait_for = []

0 commit comments

Comments
 (0)