Loading src/device/service/Tools.py +4 −4 Original line number Diff line number Diff line Loading @@ -302,18 +302,18 @@ def populate_endpoints( for dev_uuid, sub_device in new_sub_devices.items(): ctrl_uuid = get_device_controller_uuid(sub_device) LOGGER.info('dev_uuid={:s}, ctrl_uuid={:s}'.format(str(dev_uuid), str(ctrl_uuid))) if dev_uuid == device_uuid: continue # current device has no dependencies if ctrl_uuid is None: continue # sub_device has no controller if ctrl_uuid == device_uuid: continue # current device has no dependencies predecesors = graph.setdefault(dev_uuid, set()) LOGGER.info('dev_uuid={:s} predecesors={:s}'.format(str(dev_uuid), str(predecesors))) predecesors.add(ctrl_uuid) LOGGER.info('graph={:s}'.format(str(graph))) LOGGER.info('final graph={:s}'.format(str(graph))) try: ts = TopologicalSorter(graph) sorted_sub_device_uuids.extend(list(ts.static_order())) sorted_sub_device_uuids.remove(device_uuid) except CycleError: MSG = 'Topological sort failed due to cycle among sub-devices({:s}), graph({:s})' msg = MSG.format(str(new_sub_devices), str(graph)) Loading Loading
src/device/service/Tools.py +4 −4 Original line number Diff line number Diff line Loading @@ -302,18 +302,18 @@ def populate_endpoints( for dev_uuid, sub_device in new_sub_devices.items(): ctrl_uuid = get_device_controller_uuid(sub_device) LOGGER.info('dev_uuid={:s}, ctrl_uuid={:s}'.format(str(dev_uuid), str(ctrl_uuid))) if dev_uuid == device_uuid: continue # current device has no dependencies if ctrl_uuid is None: continue # sub_device has no controller if ctrl_uuid == device_uuid: continue # current device has no dependencies predecesors = graph.setdefault(dev_uuid, set()) LOGGER.info('dev_uuid={:s} predecesors={:s}'.format(str(dev_uuid), str(predecesors))) predecesors.add(ctrl_uuid) LOGGER.info('graph={:s}'.format(str(graph))) LOGGER.info('final graph={:s}'.format(str(graph))) try: ts = TopologicalSorter(graph) sorted_sub_device_uuids.extend(list(ts.static_order())) sorted_sub_device_uuids.remove(device_uuid) except CycleError: MSG = 'Topological sort failed due to cycle among sub-devices({:s}), graph({:s})' msg = MSG.format(str(new_sub_devices), str(graph)) Loading