def check_gerrit_connection(username, server, ssh_port=29418):
    """ Check that the user can connect to gerrit with ssh """
    cmd = ["ssh", "-p", str(ssh_port),
        "%s@%s" % (username, server),
        "gerrit", "version"]
    try:
        qisys.command.call(cmd, quiet=True)
    except qisys.command.CommandFailedException:
        return False
    return True
dataset/ETHPy150Open aldebaran/qibuild/python/qisrc/review.py/check_gerrit_connection/original