Fix: hostname in logging (#2914)

Co-authored-by: tobitege <tobitege@gmx.de>
This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி 2024-07-13 15:34:08 +05:30 committed by GitHub
parent f249254ba4
commit b2b6d2ac1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -419,7 +419,8 @@ class DockerSSHBox(Sandbox):
else:
password_msg = f"using the password '{self._ssh_password}'"
logger.info('Connecting to SSH session...')
ssh_cmd = f'`ssh -v -p {self._ssh_port} {username}@{hostname}`'
hostname_to_log = hostname.replace('host.docker.internal', 'localhost')
ssh_cmd = f'`ssh -v -p {self._ssh_port} {username}@{hostname_to_log}`'
logger.info(
f'You can debug the SSH connection by running: {ssh_cmd} {password_msg}'
)