def METHOD_NAME(session, name):
    """
    set a hostname for the guest
    :param session: the guest's session
    :param name: the hostname for the guest
    :return: True or False
    """
    cmd = "hostnamectl set-hostname %s" % name
    session.cmd(cmd)
    current_name = session.cmd_output("hostname")
    if name not in current_name:
        logging.error("Set hostname on the guest fail, current hostname is %s" % current_name)
        return False
    else:
        return True