def build_initiator_target_map(connector, target_wwns, lookup_service):
 init_targ_map = {}
 initiator_wwns = connector['wwpns']
 if lookup_service:
  dev_map = lookup_service.get_device_mapping_from_network(initiator_wwns, target_wwns)
  for fabric_name in dev_map:
   fabric = dev_map[fabric_name]
   for initiator in fabric['initiator_port_wwn_list']:
    init_targ_map[initiator] = fabric['target_port_wwn_list']
 else:
  for initiator in initiator_wwns:
   init_targ_map[initiator] = target_wwns
 return init_targ_map

def build_initiator_target_map ( connector , target_wwns , lookup_service ) : init_targ_map = { } initiator_wwns = connector [ 'wwpns' ] if lookup_service : dev_map = lookup_service . get_device_mapping_from_network ( initiator_wwns , target_wwns ) for fabric_name in dev_map : fabric = dev_map [ fabric_name ] for initiator in fabric [ 'initiator_port_wwn_list' ] : init_targ_map [ initiator ] = fabric [ 'target_port_wwn_list' ] else : for initiator in initiator_wwns : init_targ_map [ initiator ] = target_wwns return init_targ_map
return a dictionary mapping server-wwns and lists of storage-wwns .