'Attach K2 volume to host.'

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

    temp_client = None
    if (hasattr(volume, 'replication_status') and (volume.replication_status == K2_REP_FAILED_OVER)):
        temp_client = self.client
        self.client = self.target
    (iscsi_portal, target_iqn) = self.get_target_info(volume)
    lun = self.k2_initialize_connection(volume, connector)
    if temp_client:
        self.client = temp_client
    return {'driver_volume_type': 'iscsi', 'data': {'target_iqn': target_iqn, 'target_portal': iscsi_portal, 'target_lun': lun, 'target_discovered': True}}
