'Get zoning mappings by building up initiator/target map.
:param volume: the volume object
:param connector: the connector object
:returns: dict -- the target_wwns and initiator_target_map if the
zone is to be removed, otherwise empty'

def _get_zoning_mappings(self, volume, connector):

    loc = volume.provider_location
    name = ast.literal_eval(loc)
    host = connector['host']
    try:
        array = name['array']
        device_id = name['device_id']
    except KeyError:
        array = name['keybindings']['SystemName'].split('+')[1].strip('-')
        device_id = name['keybindings']['DeviceID']
    LOG.debug('Start    FC    detach    process    for    volume:    %(volume)s.', {'volume': volume.name})
    masking_views = self.common.get_masking_views_from_volume(array, device_id, host)
    if masking_views:
        portgroup = self.common.get_port_group_from_masking_view(array, masking_views[0])
        initiator_group = self.common.get_initiator_group_from_masking_view(array, masking_views[0])
        LOG.debug('Found    port    group:    %(portGroup)s    in    masking    view    %(maskingView)s.', {'portGroup': portgroup, 'maskingView': masking_views[0]})
        (target_wwns, init_targ_map) = self._build_initiator_target_map(volume, connector)
        zoning_mappings = {'port_group': portgroup, 'initiator_group': initiator_group, 'target_wwns': target_wwns, 'init_targ_map': init_targ_map, 'array': array}
    else:
        LOG.warning('Volume    %(volume)s    is    not    in    any    masking    view.', {'volume': volume.name})
        zoning_mappings = {}
    return zoning_mappings
