Example #1
0
    def _check_capabilities(self, uri, group=None, name=None):
        default_store = self.driver.conf.drivers.message_store
        pool_caps = self.capabilities(group=group, name=name)

        if not pool_caps:
            return True

        new_store = utils.load_storage_impl(uri, default_store=default_store)

        # NOTE(flaper87): Since all pools in a pool group
        # are assumed to have the same capabilities, it's
        # fine to check against just 1
        return pool_caps == new_store.BASE_CAPABILITIES
Example #2
0
    def _check_capabilities(self, uri, group=None, name=None):
        default_store = self.driver.conf.drivers.message_store
        pool_caps = self.capabilities(group=group, name=name)

        if not pool_caps:
            return True

        new_store = utils.load_storage_impl(uri,
                                            default_store=default_store)

        # NOTE(flaper87): Since all pools in a pool group
        # are assumed to have the same capabilities, it's
        # fine to check against just 1
        return pool_caps == new_store.BASE_CAPABILITIES
Example #3
0
    def capabilities(self, group=None, name=None):
        """Gets the set of capabilities for this group/name

        :param group: The pool group to get capabilities for
        :type group: six.text_type
        :param name: The pool name to get capabilities for
        :type name: six.text_type
        """
        if name:
            group = list(self._get_pools_by_group(self._get(name)['group']))
        else:
            group = list(self._get_pools_by_group(group))

        if not len(group) > 0:
            return ()

        default_store = self.driver.conf.drivers.message_store

        pool_store = utils.load_storage_impl(group[0]['uri'],
                                             default_store=default_store)

        return pool_store.BASE_CAPABILITIES
Example #4
0
    def capabilities(self, group=None, name=None):
        """Gets the set of capabilities for this group/name

        :param group: The pool group to get capabilities for
        :type group: six.text_type
        :param name: The pool name to get capabilities for
        :type name: six.text_type
        """
        if name:
            group = list(self._get_pools_by_group(self._get(name)['group']))
        else:
            group = list(self._get_pools_by_group(group))

        if not len(group) > 0:
            return ()

        default_store = self.driver.conf.drivers.message_store

        pool_store = utils.load_storage_impl(group[0]['uri'],
                                             default_store=default_store)

        return pool_store.BASE_CAPABILITIES
Example #5
0
    def capabilities(self, flavor=None, name=None):
        """Gets the set of capabilities for this flavor/name

        :param flavor: The pool flavor to get capabilities for
        :type flavor: six.text_type
        :param name: The pool name to get capabilities for
        :type name: six.text_type
        """
        pllt = []
        if name:
            pool = self.get(name)
            pllt.append(pool)
        else:
            pllt = list(self._get_pools_by_flavor(flavor))

        if not len(pllt) > 0:
            return ()

        default_store = self.driver.conf.drivers.message_store

        pool_store = utils.load_storage_impl(pllt[0]['uri'],
                                             default_store=default_store)

        return pool_store.BASE_CAPABILITIES
Example #6
0
    def capabilities(self, flavor=None, name=None):
        """Gets the set of capabilities for this flavor/name

        :param flavor: The pool flavor to get capabilities for
        :type flavor: six.text_type
        :param name: The pool name to get capabilities for
        :type name: six.text_type
        """
        pllt = []
        if name:
            pool = self.get(name)
            pllt.append(pool)
        else:
            pllt = list(self._get_pools_by_flavor(flavor))

        if not len(pllt) > 0:
            return ()

        default_store = self.driver.conf.drivers.message_store

        pool_store = utils.load_storage_impl(pllt[0]['uri'],
                                             default_store=default_store)

        return pool_store.BASE_CAPABILITIES