revert -N, add comment

This commit is contained in:
Ryan Mukherjee 2023-06-21 11:23:40 -04:00 committed by GitHub
parent 4a946d69a5
commit 78ea4bf4f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -669,7 +669,7 @@ def wait_for_machine(state, task):
def start_ssh_tunnel(username, remote_address, ssh_port, ssh_password, local_remote_pair_list, debug=False): def start_ssh_tunnel(username, remote_address, ssh_port, ssh_password, local_remote_pair_list, debug=False):
print('Starting SSH tunnel') print('Starting SSH tunnel')
child = None child = None
args = ['-C', args = ['-N', '-C',
'{}@{}'.format(username, remote_address), '-p', '{}'.format(ssh_port), '{}@{}'.format(username, remote_address), '-p', '{}'.format(ssh_port),
'-o', 'UserKnownHostsFile=/dev/null', '-o', 'UserKnownHostsFile=/dev/null',
'-o', 'Compression=yes', '-o', 'Compression=yes',
@ -690,6 +690,7 @@ def start_ssh_tunnel(username, remote_address, ssh_port, ssh_password, local_rem
args=args, args=args,
logfile=fd, timeout=20, encoding='utf-8') logfile=fd, timeout=20, encoding='utf-8')
# Match only "(yes/no" in order to handle both (yes/no) and (yes/no/[fingerprint])
i = child.expect([r'(?i)password:', r'\(yes\/no', r'.*[$#] ', pexpect.EOF]) i = child.expect([r'(?i)password:', r'\(yes\/no', r'.*[$#] ', pexpect.EOF])
if i == 0: if i == 0:
child.sendline(ssh_password) child.sendline(ssh_password)