def _build_ssh_command(hostname, username, idfile, ssh_command, tunnel):
command = [_get_path('<STR_LIT>'),<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>']<EOL>if idfile is not None:<EOL><INDENT>command.extend(['<STR_LIT>', idfile])<EOL><DEDENT>if tunnel is not None:<EOL><INDENT>command.extend(['<STR_LIT>', '<STR_LIT>', tunnel, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>if username is not None:<EOL><INDENT>command.append('<STR_LIT>'.format(username, hostname))<EOL><DEDENT>else:<EOL><INDENT>command.append(hostname)<EOL><DEDENT>if ssh_command is not None:<EOL><INDENT>command.append(repr(ssh_command))<EOL><DEDENT>return('<STR_LIT:U+0020>'.join(command))<EOL>
Uses hostname and other info to construct an SSH command.