Exemplo n.º 1
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Build the Pool (and related) Object from Config
        self.pool = objects.Pool.from_config(
            CONF, CONF['service:pool_manager'].pool_id)

        # Get a pool manager cache connection.
        self.cache = cache.get_pool_manager_cache(
            CONF['service:pool_manager'].cache_driver)

        # Store some settings for quick access later
        self.threshold = CONF['service:pool_manager'].threshold_percentage
        self.timeout = CONF['service:pool_manager'].poll_timeout
        self.retry_interval = CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = CONF['service:pool_manager'].poll_max_retries
        self.delay = CONF['service:pool_manager'].poll_delay
        self._periodic_sync_max_attempts = \
            CONF['service:pool_manager'].periodic_sync_max_attempts
        self._periodic_sync_retry_interval = \
            CONF['service:pool_manager'].periodic_sync_retry_interval

        # Compute a time (seconds) by which things should have propagated
        self.max_prop_time = (self.timeout * self.max_retries +
                             self.max_retries * self.retry_interval +
                             self.delay)

        # Create the necessary Backend instances for each target
        self._setup_target_backends()
Exemplo n.º 2
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Build the Pool (and related) Object from Config
        self.pool = objects.Pool.from_config(
            CONF, CONF['service:pool_manager'].pool_id)

        # Get a pool manager cache connection.
        self.cache = cache.get_pool_manager_cache(
            CONF['service:pool_manager'].cache_driver)

        # Store some settings for quick access later
        self.threshold = CONF['service:pool_manager'].threshold_percentage
        self.timeout = CONF['service:pool_manager'].poll_timeout
        self.retry_interval = CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = CONF['service:pool_manager'].poll_max_retries
        self.delay = CONF['service:pool_manager'].poll_delay
        self._periodic_sync_max_attempts = \
            CONF['service:pool_manager'].periodic_sync_max_attempts
        self._periodic_sync_retry_interval = \
            CONF['service:pool_manager'].periodic_sync_retry_interval

        # Compute a time (seconds) by which things should have propagated
        self.max_prop_time = (self.timeout * self.max_retries +
                              self.max_retries * self.retry_interval +
                              self.delay)

        # Create the necessary Backend instances for each target
        self._setup_target_backends()
Exemplo n.º 3
0
    def setUp(self):
        super(MemcachePoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('memcache')
        self.mock_status = Mock(
            server_id='server_id',
            domain_id='domain_id',
            action='CREATE',
        )
Exemplo n.º 4
0
    def setUp(self):
        super(MemcachePoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('memcache')
        self.mock_status = Mock(
            nameserver_id='nameserver_id',
            zone_id='zone_id',
            action='CREATE',
        )
Exemplo n.º 5
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Get a pool manager cache connection.
        cache_driver = cfg.CONF['service:pool_manager'].cache_driver
        self.cache = cache.get_pool_manager_cache(cache_driver)

        self.threshold = cfg.CONF['service:pool_manager'].threshold_percentage
        self.timeout = cfg.CONF['service:pool_manager'].poll_timeout
        self.retry_interval = \
            cfg.CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = cfg.CONF['service:pool_manager'].poll_max_retries
        self.delay = cfg.CONF['service:pool_manager'].poll_delay

        self.server_backends = []

        sections = []
        for backend_name in cfg.CONF['service:pool_manager'].backends:
            server_ids = cfg.CONF['backend:%s' % backend_name].server_ids

            for server_id in server_ids:
                sections.append({
                    "backend": backend_name,
                    "server_id": server_id
                })

        for section in sections:
            backend_driver = section['backend']
            server_id = section['server_id']
            server = backend.get_server_object(backend_driver, server_id)

            backend_instance = backend.get_backend(backend_driver,
                                                   server.backend_options)
            server_backend = {
                'server': server,
                'backend_instance': backend_instance
            }
            self.server_backends.append(server_backend)

        if not self.server_backends:
            raise exceptions.NoPoolServersConfigured()

        self.enable_recovery_timer = \
            cfg.CONF['service:pool_manager'].enable_recovery_timer
        self.enable_sync_timer = \
            cfg.CONF['service:pool_manager'].enable_sync_timer
Exemplo n.º 6
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Build the Pool (and related) Object from Config
        self.pool = objects.Pool.from_config(CONF)

        # Get a pool manager cache connection.
        self.cache = cache.get_pool_manager_cache(
            CONF['service:pool_manager'].cache_driver)

        # Store some settings for quick access later
        self.threshold = CONF['service:pool_manager'].threshold_percentage
        self.timeout = CONF['service:pool_manager'].poll_timeout
        self.retry_interval = CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = CONF['service:pool_manager'].poll_max_retries
        self.delay = CONF['service:pool_manager'].poll_delay

        # Create the necessary Backend instances for each target
        self._setup_target_backends()
Exemplo n.º 7
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Build the Pool (and related) Object from Config
        self.pool = objects.Pool.from_config(CONF)

        # Get a pool manager cache connection.
        self.cache = cache.get_pool_manager_cache(
            CONF['service:pool_manager'].cache_driver)

        # Store some settings for quick access later
        self.threshold = CONF['service:pool_manager'].threshold_percentage
        self.timeout = CONF['service:pool_manager'].poll_timeout
        self.retry_interval = CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = CONF['service:pool_manager'].poll_max_retries
        self.delay = CONF['service:pool_manager'].poll_delay

        # Create the necessary Backend instances for each target
        self._setup_target_backends()
Exemplo n.º 8
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Get a pool manager cache connection.
        self.cache = cache.get_pool_manager_cache(
            CONF['service:pool_manager'].cache_driver)

        # Store some settings for quick access later
        self.threshold = CONF['service:pool_manager'].threshold_percentage
        self.timeout = CONF['service:pool_manager'].poll_timeout
        self.retry_interval = CONF['service:pool_manager'].poll_retry_interval
        self.max_retries = CONF['service:pool_manager'].poll_max_retries
        self.delay = CONF['service:pool_manager'].poll_delay
        self._periodic_sync_max_attempts = \
            CONF['service:pool_manager'].periodic_sync_max_attempts
        self._periodic_sync_retry_interval = \
            CONF['service:pool_manager'].periodic_sync_retry_interval

        # Compute a time (seconds) by which things should have propagated
        self.max_prop_time = utils.max_prop_time(self.timeout,
            self.max_retries, self.retry_interval, self.delay)
Exemplo n.º 9
0
    def setUp(self):
        super(SqlalchemyPoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('sqlalchemy')
Exemplo n.º 10
0
    def setUp(self):
        super(NoopPoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('noop')
Exemplo n.º 11
0
    def setUp(self):
        super(NoopPoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('noop')
Exemplo n.º 12
0
    def setUp(self):
        super(SqlalchemyPoolManagerCacheTest, self).setUp()

        self.cache = cache.get_pool_manager_cache('sqlalchemy')