nixos-rebuild-ng: move atexit.register(cleanup_ssh) to process

This commit is contained in:
Thiago Kenji Okada
2024-12-16 18:53:05 +00:00
parent aae4abe6c1
commit 3d8b0daa1a
2 changed files with 4 additions and 3 deletions
@@ -1,5 +1,4 @@
import argparse
import atexit
import json
import logging
import os
@@ -293,8 +292,6 @@ def execute(argv: list[str]) -> None:
if not WITH_NIX_2_18:
logger.warning("you're using Nix <2.18, some features will not work correctly")
atexit.register(cleanup_ssh)
common_flags = vars(args_groups["common_flags"])
common_build_flags = common_flags | vars(args_groups["common_build_flags"])
build_flags = common_build_flags | vars(args_groups["classic_build_flags"])
@@ -1,3 +1,4 @@
import atexit
import logging
import os
import shlex
@@ -76,6 +77,9 @@ def cleanup_ssh() -> None:
)
atexit.register(cleanup_ssh)
def run_wrapper(
args: Sequence[str | bytes | os.PathLike[str] | os.PathLike[bytes]],
*,