'Present volume to host at specified LUN'

def _present_volume(self, volume, hostname, lun):

    target_lun = lun
    params = {'volumename': volume['name'], 'hostname': hostname}
    if (target_lun != ''):
        params['lun'] = target_lun
    url = ('/storage/arrays/%s/allocations' % self._get_ise_globalid())
    resp = self._send_cmd('POST', url, params)
    status = resp['status']
    if (status == 201):
        LOG.info('Volume    %s    presented.', volume['name'])
    elif (status == 409):
        LOG.warning('Volume    %(name)s    already    presented    (%(status)d)!', {'name': volume['name'], 'status': status})
    else:
        LOG.error('Failed    to    present    volume    %(name)s    (%(status)d)!', {'name': volume['name'], 'status': status})
        RaiseXIODriverException()
    location = resp['location']
    if (location == ''):
        location = self._alloc_location(volume, hostname)
    if (location != ''):
        target_lun = self._find_target_lun(location)
    LOG.debug('Volume    %(volume)s    presented:    %(host)s    %(lun)s', {'volume': volume['name'], 'host': hostname, 'lun': target_lun})
    return target_lun
