def ConnectAndResumeReassignPortsNgpfHlPy(ixNetworkTclServer, tclServer, userName, portList, chassisIp ): ''' Connect to an existing configuration and use the provided list of portList. portList format: 1/3. Not 1/1/3. This API will return all session configuration handles. ''' connectStatus = ixia_ngpf.connect ( ixnetwork_tcl_server = ixNetworkTclServer, tcl_server = tclServer, username = userName, port_list = portList, device = chassisIp, session_resume_keys = '1', break_locks = '1', ) if connectStatus['status'] != '1': return 1 else: return connectStatus erify]['aggregate']['sessions_up'] totalSessions = sessionStatus[eachProtocolSessionToVerify]['aggregate']['sessions_total'] print '\nVerifying protocol sessions', eachProtocolSessionToVerify print '\t%s/%s: CurrentSessionUp:%s TotalSessions:%s\n' % (timer, totalTime, currentSessionUp, totalSessions) if timer < totalTime and currentSessionUp != totalSessions: time.sleep(1) continue if timer < totalTime and currentSessionUp == totalSessions: break if timer == totalTime and currentSessionUp != totalSessions: print '\nError: It has been %s seconds and total sessions are not all UP. ' % timer errorFlag = 1 if errorFlag: sys.exit()