示例#1
0
文件: pooling.py 项目: rose/zaqar
    def _init_driver(self, pool_id):
        """Given a pool name, returns a storage driver.

        :param pool_id: The name of a pool.
        :type pool_id: six.text_type
        :returns: a storage driver
        :rtype: zaqar.storage.base.DataDriverBase
        """
        pool = self._pools_ctrl.get(pool_id, detailed=True)
        conf = utils.dynamic_conf(pool['uri'], pool['options'],
                                  conf=self._conf)
        return utils.load_storage_driver(conf, self._cache)
示例#2
0
文件: pooling.py 项目: rose/zaqar
    def _init_driver(self, pool_id):
        """Given a pool name, returns a storage driver.

        :param pool_id: The name of a pool.
        :type pool_id: six.text_type
        :returns: a storage driver
        :rtype: zaqar.storage.base.DataDriverBase
        """
        pool = self._pools_ctrl.get(pool_id, detailed=True)
        conf = utils.dynamic_conf(pool['uri'],
                                  pool['options'],
                                  conf=self._conf)
        return utils.load_storage_driver(conf, self._cache)
示例#3
0
文件: pooling.py 项目: neerja28/zaqar
    def _init_driver(self, pool_id, pool_conf=None):
        """Given a pool name, returns a storage driver.

        :param pool_id: The name of a pool.
        :type pool_id: six.text_type
        :returns: a storage driver
        :rtype: zaqar.storage.base.DataDriverBase
        """
        if pool_id is not None:
            pool = self._pools_ctrl.get(pool_id, detailed=True)
        else:
            pool = pool_conf
        conf = utils.dynamic_conf(pool["uri"], pool["options"], conf=self._conf)
        storage = utils.load_storage_driver(conf, self._cache, control_driver=self.control)
        return pipeline.DataDriver(conf, storage, self.control)
示例#4
0
文件: pooling.py 项目: xglhjk6/zaqar
    def _init_driver(self, pool_id, pool_conf=None):
        """Given a pool name, returns a storage driver.

        :param pool_id: The name of a pool.
        :type pool_id: six.text_type
        :returns: a storage driver
        :rtype: zaqar.storage.base.DataDriverBase
        """
        if pool_id is not None:
            pool = self._pools_ctrl.get(pool_id, detailed=True)
        else:
            pool = pool_conf
        conf = utils.dynamic_conf(pool['uri'], pool['options'],
                                  conf=self._conf)
        storage = utils.load_storage_driver(conf,
                                            self._cache,
                                            control_driver=self.control)
        return pipeline.DataDriver(conf, storage, self.control)