def iscsi_logout(target_name=None):
 if target_name:
  cmd = ('iscsiadm --mode node --logout -T %s' % target_name)
 else:
  cmd = 'iscsiadm --mode node --logout all'
 output = utils.system_output(cmd)
 target_logout = ''
 if ('successful' in output):
  target_logout = target_name
 return target_logout

def iscsi_logout ( target_name = None ) : if target_name : cmd = ( 'iscsiadm --mode node --logout -T %s' % target_name ) else : cmd = 'iscsiadm --mode node --logout all' output = utils . system_output ( cmd ) target_logout = '' if ( 'successful' in output ) : target_logout = target_name return target_logout
logout from a target .