diff options
author | Matt Clay <matt@mystile.com> | 2023-06-21 23:41:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 23:41:25 +0200 |
commit | c3926268e226da771943cbdb96f65fd343a980d5 (patch) | |
tree | cda6e591e0ad02c4b6801c7086422dbe45c7320b /test/lib/ansible_test/_internal/provisioning.py | |
parent | Fix typo in to_yaml filter examples (#81094) (diff) | |
download | ansible-c3926268e226da771943cbdb96f65fd343a980d5.tar.xz ansible-c3926268e226da771943cbdb96f65fd343a980d5.zip |
ansible-test - Avoid using atexit module (#81096)
Diffstat (limited to 'test/lib/ansible_test/_internal/provisioning.py')
-rw-r--r-- | test/lib/ansible_test/_internal/provisioning.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lib/ansible_test/_internal/provisioning.py b/test/lib/ansible_test/_internal/provisioning.py index e7f0fd317e..4710757bd0 100644 --- a/test/lib/ansible_test/_internal/provisioning.py +++ b/test/lib/ansible_test/_internal/provisioning.py @@ -1,7 +1,6 @@ """Provision hosts for running tests.""" from __future__ import annotations -import atexit import collections.abc as c import dataclasses import functools @@ -27,6 +26,10 @@ from .util import ( type_guard, ) +from .util_common import ( + ExitHandler, +) + from .thread import ( WrappedThread, ) @@ -124,7 +127,7 @@ def prepare_profiles( raise PrimeContainers() - atexit.register(functools.partial(cleanup_profiles, host_state)) + ExitHandler.register(functools.partial(cleanup_profiles, host_state)) def provision(profile: HostProfile) -> None: """Provision the given profile.""" |