Merge "Pool Manager Throws An Error When No Servers are Defined"
This commit is contained in:
commit
c5ec416b7a
@ -73,6 +73,11 @@ class NoServersConfigured(ConfigurationError):
|
|||||||
error_type = 'no_servers_configured'
|
error_type = 'no_servers_configured'
|
||||||
|
|
||||||
|
|
||||||
|
class NoPoolServersConfigured(ConfigurationError):
|
||||||
|
error_code = 500
|
||||||
|
error_type = 'no_pool_servers_configured'
|
||||||
|
|
||||||
|
|
||||||
class OverQuota(Base):
|
class OverQuota(Base):
|
||||||
error_code = 413
|
error_code = 413
|
||||||
error_type = 'over_quota'
|
error_type = 'over_quota'
|
||||||
|
@ -121,6 +121,9 @@ class Service(service.RPCService):
|
|||||||
}
|
}
|
||||||
self.server_backends.append(server_backend)
|
self.server_backends.append(server_backend)
|
||||||
|
|
||||||
|
if not self.server_backends:
|
||||||
|
raise exceptions.NoPoolServersConfigured()
|
||||||
|
|
||||||
self.enable_recovery_timer = \
|
self.enable_recovery_timer = \
|
||||||
cfg.CONF['service:pool_manager'].enable_recovery_timer
|
cfg.CONF['service:pool_manager'].enable_recovery_timer
|
||||||
self.enable_sync_timer = \
|
self.enable_sync_timer = \
|
||||||
|
@ -67,6 +67,16 @@ class PoolManagerServiceTest(PoolManagerTestCase):
|
|||||||
# NOTE: Start is already done by the fixture in start_service()
|
# NOTE: Start is already done by the fixture in start_service()
|
||||||
self.service.stop()
|
self.service.stop()
|
||||||
|
|
||||||
|
def test_no_pool_servers_configured(self):
|
||||||
|
self.service.stop()
|
||||||
|
self.config(
|
||||||
|
server_ids=[],
|
||||||
|
group='backend:fake'
|
||||||
|
)
|
||||||
|
|
||||||
|
with testtools.ExpectedException(exceptions.NoPoolServersConfigured):
|
||||||
|
self.start_service('pool_manager')
|
||||||
|
|
||||||
@patch.object(mdns_rpcapi.MdnsAPI, 'poll_for_serial_number')
|
@patch.object(mdns_rpcapi.MdnsAPI, 'poll_for_serial_number')
|
||||||
@patch.object(mdns_rpcapi.MdnsAPI, 'notify_zone_changed')
|
@patch.object(mdns_rpcapi.MdnsAPI, 'notify_zone_changed')
|
||||||
def test_create_domain(self, mock_notify_zone_changed,
|
def test_create_domain(self, mock_notify_zone_changed,
|
||||||
|
Loading…
Reference in New Issue
Block a user