def get_shortest_path(self, nx_graph, src_dpid, dst_dpid): if nx.has_path(nx_graph, src_dpid, dst_dpid): return nx.shortest_path(nx_graph, src_dpid, dst_dpid) return None