'Maps LUN to the initiator(s) and returns LUN ID assigned.'

def _map_lun(self, name, initiator_list, initiator_type, lun_id=None):

    metadata = self._get_lun_attr(name, 'metadata')
    path = metadata['Path']
    (igroup_name, ig_host_os, ig_type) = self._get_or_create_igroup(initiator_list, initiator_type, self.host_type)
    if (ig_host_os != self.host_type):
        LOG.warning('LUN    misalignment    may    occur    for    current    initiator    group    %(ig_nm)s)    with    host    OS    type    %(ig_os)s.    Please    configure    initiator    group    manually    according    to    the    type    of    the    host    OS.', {'ig_nm': igroup_name, 'ig_os': ig_host_os})
    try:
        return self.zapi_client.map_lun(path, igroup_name, lun_id=lun_id)
    except netapp_api.NaApiError:
        exc_info = sys.exc_info()
        (_igroup, lun_id) = self._find_mapped_lun_igroup(path, initiator_list)
        if (lun_id is not None):
            return lun_id
        else:
            six.reraise(*exc_info)
