def iscsi_get_sessions():
 cmd = 'iscsiadm --mode session'
 output = utils.system_output(cmd, ignore_status=True)
 sessions = []
 if ('No active sessions' not in output):
  for session in output.splitlines():
   ip_addr = session.split()[2].split(',')[0]
   target = session.split()[3]
   sessions.append((ip_addr, target))
 return sessions

def iscsi_get_sessions ( ) : cmd = 'iscsiadm --mode session' output = utils . system_output ( cmd , ignore_status = True ) sessions = [ ] if ( 'No active sessions' not in output ) : for session in output . splitlines ( ) : ip_addr = session . split ( ) [ 2 ] . split ( ',' ) [ 0 ] target = session . split ( ) [ 3 ] sessions . append ( ( ip_addr , target ) ) return sessions
get the iscsi sessions activated .