'Allow connection to connector and return connection info.'

@utils.synchronized('quobyte', external=False)
def initialize_connection(self, volume, connector):

    active_file = self.get_active_image_from_info(volume)
    path = ('%s/%s/%s' % (self.configuration.quobyte_mount_point_base, self._get_hash_str(volume.provider_location), active_file))
    data = {'export': volume.provider_location, 'name': active_file}
    if (volume.provider_location in self.shares):
        data['options'] = self.shares[volume.provider_location]
    info = self._qemu_img_info(path, volume.name)
    data['format'] = info.file_format
    if (data['format'] not in ['raw', 'qcow2']):
        msg = (_('%s    must    be    a    valid    raw    or    qcow2    image.') % path)
        raise exception.InvalidVolume(msg)
    return {'driver_volume_type': 'quobyte', 'data': data, 'mount_point_base': self.configuration.quobyte_mount_point_base}
