def getSessionInfo(self): sessions = iscsi.iterateIscsiSessions() try: info = iscsi.getSessionInfo(self._lastSessionId) sessions = chain(info, sessions) except Exception: pass for session in iscsi.iterateIscsiSessions(): if self.isSession(session): self._lastSessionId = session.id return session raise OSError(errno.ENOENT, "Session not found")
def getSessionInfo(self): for session in iscsi.iterateIscsiSessions(): if self.isSession(session): self._lastSessionId = session.id return session raise OSError(errno.ENOENT, "Session not found")
def getSessionInfo(self): errors = [] for session in iscsi.iterateIscsiSessions(): try: self._match(session) except self.Mismatch as e: errors.append(e) else: return session self.log.debug("Session mismatches: %s", errors) raise OSError(errno.ENOENT, "Session not found")