Use specific Route53Provider Exception

This commit is contained in:
Jörg Runkel
2019-03-22 17:30:49 +01:00
parent 07b7f1e8ef
commit 00ee5053c7
2 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -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,
+2 -2
View File
@@ -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):