diff --git a/rdma/discovery.py b/rdma/discovery.py index 880cd5a..0806c74 100644 --- a/rdma/discovery.py +++ b/rdma/discovery.py @@ -1,5 +1,6 @@ # Copyright 2011 Obsidian Research Corp. GPLv2, see COPYING. import rdma; +import logging; import collections; import rdma.path; import rdma.satransactor; @@ -293,7 +294,12 @@ def do_todo(self,old_ctx,bucket,depth): def do_port(self,path,node,aport,portIdx,depth): """Coroutine to get a :class:`~rdma.IBA.SMPPortInfo` and schedule scanning the attached node, if applicable.""" - pinf = yield self.sched.SubnGet(IBA.SMPPortInfo,path,portIdx); + try: + pinf = yield self.sched.SubnGet(IBA.SMPPortInfo,path,portIdx) + except rdma.RDMAError as e: + logging.error(e) + pinf = IBA.SMPPortInfo() + pinf.portState = IBA.PORT_STATE_DOWN aport = self.sbn.get_port_pinf(pinf,path=path,portIdx=portIdx); if self.lid_route and isinstance(path,rdma.path.IBDRPath): @@ -319,7 +325,12 @@ def do_port(self,path,node,aport,portIdx,depth): def do_node(self,path,depth=0,peer=None): """Coroutine to get the :class:`~rdma.IBA.SMPNodeInfo` and scan all the port infos.""" - ninf = yield self.sched.SubnGet(IBA.SMPNodeInfo,path); + try: + ninf = yield self.sched.SubnGet(IBA.SMPNodeInfo,path); + except rdma.RDMAError as err: + logging.error(err) + return + node,port = self.sbn.get_node_ninf(ninf,path); if isinstance(node,rdma.subnet.Switch):