From 1483f4946159389d9b4706994a7a07169d18603d Mon Sep 17 00:00:00 2001 From: gryf Date: Wed, 22 Feb 2023 21:08:43 +0100 Subject: [PATCH] Added debug info about ssh connection to the vm --- box.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/box.py b/box.py index 0ef6c6f..70e9691 100755 --- a/box.py +++ b/box.py @@ -1470,11 +1470,14 @@ def connect(args): return 16 username = conf.username or DISTROS[conf.distro]["username"] - return Run(['ssh', '-o', 'StrictHostKeyChecking=no', - '-o', 'UserKnownHostsFile=/dev/null', - '-i', conf.ssh_key_path[:-4], - f'ssh://{username}' - f'@localhost:{conf.port}'], False).returncode + cmd = ['ssh', '-o', 'StrictHostKeyChecking=no', + '-o', 'UserKnownHostsFile=/dev/null', + '-i', conf.ssh_key_path[:-4], + f'ssh://{username}' + f'@localhost:{conf.port}'] + LOG.debug('Connecting to vm `%s` using command:\n%s', args.name, + ' '.join(cmd)) + return Run(cmd, False).returncode def _set_vmstate(name, state):