Loading src/webui/service/main/routes.py +1 −8 Original line number Diff line number Diff line Loading @@ -131,25 +131,18 @@ def topology(): topology_uuid = session['topology_uuid'] json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) response = context_client.GetTopologyDetails(TopologyId(**json_topo_id)) topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} topo_link_uuids = {link_id .link_uuid .uuid for link_id in grpc_topology.link_ids } response = context_client.ListDevices(Empty()) devices = [] for device in response.devices: if device.device_id.device_uuid.uuid not in topo_device_uuids: continue devices.append({ 'id': device.device_id.device_uuid.uuid, 'name': device.name, 'type': device.device_type, }) response = context_client.ListLinks(Empty()) links = [] for link in response.links: if link.link_id.link_uuid.uuid not in topo_link_uuids: continue if len(link.link_endpoint_ids) != 2: str_link = grpc_message_to_json_string(link) LOGGER.warning('Unexpected link with len(endpoints) != 2: {:s}'.format(str_link)) Loading Loading
src/webui/service/main/routes.py +1 −8 Original line number Diff line number Diff line Loading @@ -131,25 +131,18 @@ def topology(): topology_uuid = session['topology_uuid'] json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) response = context_client.GetTopologyDetails(TopologyId(**json_topo_id)) topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} topo_link_uuids = {link_id .link_uuid .uuid for link_id in grpc_topology.link_ids } response = context_client.ListDevices(Empty()) devices = [] for device in response.devices: if device.device_id.device_uuid.uuid not in topo_device_uuids: continue devices.append({ 'id': device.device_id.device_uuid.uuid, 'name': device.name, 'type': device.device_type, }) response = context_client.ListLinks(Empty()) links = [] for link in response.links: if link.link_id.link_uuid.uuid not in topo_link_uuids: continue if len(link.link_endpoint_ids) != 2: str_link = grpc_message_to_json_string(link) LOGGER.warning('Unexpected link with len(endpoints) != 2: {:s}'.format(str_link)) Loading