mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Use specific Route53Provider Exception
This commit is contained in:
@@ -211,6 +211,10 @@ class _Route53GeoRecord(_Route53Record):
|
||||
self.values)
|
||||
|
||||
|
||||
class Route53ProviderException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Route53Provider(BaseProvider):
|
||||
'''
|
||||
AWS Route53 Provider
|
||||
@@ -557,8 +561,9 @@ class Route53Provider(BaseProvider):
|
||||
if (interval in [10, 30]):
|
||||
return interval
|
||||
else:
|
||||
raise Exception('route53.healthcheck.request_interval '
|
||||
'parameter must be either 10 or 30.')
|
||||
raise Route53ProviderException(
|
||||
'route53.healthcheck.request_interval '
|
||||
'parameter must be either 10 or 30.')
|
||||
|
||||
def _health_check_equivilent(self, host, path, protocol, port,
|
||||
measure_latency, request_interval,
|
||||
|
||||
@@ -12,7 +12,7 @@ from mock import patch
|
||||
|
||||
from octodns.record import Create, Delete, Record, Update
|
||||
from octodns.provider.route53 import Route53Provider, _Route53GeoDefault, \
|
||||
_Route53GeoRecord, _Route53Record, _octal_replace
|
||||
_Route53GeoRecord, _Route53Record, _octal_replace, Route53ProviderException
|
||||
from octodns.zone import Zone
|
||||
|
||||
from helpers import GeoProvider
|
||||
@@ -944,7 +944,7 @@ class TestRoute53Provider(TestCase):
|
||||
}
|
||||
}
|
||||
})
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises(Route53ProviderException):
|
||||
interval = provider._healthcheck_request_interval(record_invalid)
|
||||
|
||||
def test_create_health_checks_provider_options(self):
|
||||
|
||||
Reference in New Issue
Block a user