def host_info_format(host_info: dict):
    """
    格式化机器信息，如果主机名和IP一样就只显示IP，否则在括号中显示主机名称
    :param host_info:
    :return:
    """
    if host_info["name"] == host_info["ip"]:
        return host_info["ip"]
    else:
        return "%s(%s)" % (host_info["ip"], host_info["name"])