ansible-test - Fix ansible-test debug from remote shell (#85321)

(cherry picked from commit 2991883672)
pull/85383/head
Matt Clay 7 months ago
parent 73df36e7d0
commit b5529ee064

@ -2,6 +2,7 @@
from __future__ import annotations
import dataclasses
import os
import sys
import typing as t
@ -107,6 +108,10 @@ def command_shell(args: ShellConfig) -> None:
con.run(args.cmd, capture=False, interactive=False, output_stream=OutputStream.ORIGINAL)
return
if isinstance(con, LocalConnection) and isinstance(target_profile, DebuggableProfile) and target_profile.debugging_enabled:
# HACK: ensure the pydevd port visible in the shell is the forwarded port, not the original
args.metadata.debugger_settings = dataclasses.replace(args.metadata.debugger_settings, port=target_profile.pydevd_port)
with metadata_context(args):
interactive_shell(args, target_profile, con)

Loading…
Cancel
Save