def parse_volume_info(connection_data):
 volume_id = connection_data['volume_id']
 target_portal = connection_data['target_portal']
 target_host = _get_target_host(target_portal)
 target_port = _get_target_port(target_portal)
 target_iqn = connection_data['target_iqn']
 LOG.debug('(vol_id,number,host,port,iqn): (%s,%s,%s,%s)', volume_id, target_host, target_port, target_iqn)
 if ((volume_id is None) or (target_host is None) or (target_iqn is None)):
  raise StorageError((_('Unable to obtain target information %(connection_data)s') % locals()))
 volume_info = {}
 volume_info['id'] = volume_id
 volume_info['target'] = target_host
 volume_info['port'] = target_port
 volume_info['targetIQN'] = target_iqn
 if (('auth_method' in connection_data) and (connection_data['auth_method'] == 'CHAP')):
  volume_info['chapuser'] = connection_data['auth_username']
  volume_info['chappassword'] = connection_data['auth_password']
 return volume_info

def parse_volume_info ( connection_data ) : volume_id = connection_data [ 'volume_id' ] target_portal = connection_data [ 'target_portal' ] target_host = _get_target_host ( target_portal ) target_port = _get_target_port ( target_portal ) target_iqn = connection_data [ 'target_iqn' ] LOG . debug ( '(vol_id,number,host,port,iqn): (%s,%s,%s,%s)' , volume_id , target_host , target_port , target_iqn ) if ( ( volume_id is None ) or ( target_host is None ) or ( target_iqn is None ) ) : raise StorageError ( ( _ ( 'Unable to obtain target information %(connection_data)s' ) % locals ( ) ) ) volume_info = { } volume_info [ 'id' ] = volume_id volume_info [ 'target' ] = target_host volume_info [ 'port' ] = target_port volume_info [ 'targetIQN' ] = target_iqn if ( ( 'auth_method' in connection_data ) and ( connection_data [ 'auth_method' ] == 'CHAP' ) ) : volume_info [ 'chapuser' ] = connection_data [ 'auth_username' ] volume_info [ 'chappassword' ] = connection_data [ 'auth_password' ] return volume_info
parse device_path and mountpoint as they can be used by xenapi .