'Attach K2 volume to host.'

@fczm_utils.add_fc_zone
@kaminario_logger
@coordination.synchronized('{self.k2_lock_name}')
def initialize_connection(self, volume, connector):

    if (not connector.get('wwpns')):
        msg = _('No    wwpns    found    in    host    connector.')
        LOG.error(msg)
        raise exception.KaminarioCinderDriverException(reason=msg)
    temp_client = None
    if (hasattr(volume, 'replication_status') and (volume.replication_status == K2_REP_FAILED_OVER)):
        temp_client = self.client
        self.client = self.target
    target_wwpns = self.get_target_info(volume)
    lun = self.k2_initialize_connection(volume, connector)
    (target_wwpns, init_target_map) = self._build_initiator_target_map(connector, target_wwpns)
    if temp_client:
        self.client = temp_client
    return {'driver_volume_type': 'fibre_channel', 'data': {'target_discovered': True, 'target_lun': lun, 'target_wwn': target_wwpns, 'initiator_target_map': init_target_map}}
