1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

more consistent naming, pural secrets

This commit is contained in:
Ross McFarland
2024-03-11 14:51:06 -07:00
parent ec9c3bcc29
commit b539cb0a4f
4 changed files with 8 additions and 8 deletions

View File

@@ -5,10 +5,10 @@
from os import environ
from .base import BaseSecrets
from .exception import SecretException
from .exception import SecretsException
class EnvironSecretException(SecretException):
class EnvironSecretsException(SecretsException):
pass
@@ -19,7 +19,7 @@ class EnvironSecrets(BaseSecrets):
v = environ[name]
except KeyError:
self.log.exception('Invalid provider config')
raise EnvironSecretException(
raise EnvironSecretsException(
f'Incorrect provider config, missing env var {name}, {source.context}'
)
try:

View File

@@ -3,5 +3,5 @@
#
class SecretException(Exception):
class SecretsException(Exception):
pass

View File

@@ -28,7 +28,7 @@ from octodns.manager import (
)
from octodns.processor.base import BaseProcessor
from octodns.record import Create, Delete, Record, Update
from octodns.secret.environ import EnvironSecretException
from octodns.secret.environ import EnvironSecretsException
from octodns.yaml import safe_load
from octodns.zone import Zone
@@ -72,7 +72,7 @@ class TestManager(TestCase):
def test_missing_env_config(self):
# details of the EnvironSecrets will be tested in dedicated tests
with self.assertRaises(EnvironSecretException) as ctx:
with self.assertRaises(EnvironSecretsException) as ctx:
Manager(get_config_filename('missing-provider-env.yaml')).sync()
self.assertTrue('missing env var' in str(ctx.exception))

View File

@@ -6,7 +6,7 @@ from os import environ
from unittest import TestCase
from octodns.context import ContextDict
from octodns.secret.environ import EnvironSecretException, EnvironSecrets
from octodns.secret.environ import EnvironSecrets, EnvironSecretsException
class TestEnvironSecrets(TestCase):
@@ -23,7 +23,7 @@ class TestEnvironSecrets(TestCase):
self.assertEqual(42, es.fetch('THIS_IS_AN_INT', source))
self.assertEqual(43.44, es.fetch('THIS_IS_A_FLOAT', source))
with self.assertRaises(EnvironSecretException) as ctx:
with self.assertRaises(EnvironSecretsException) as ctx:
es.fetch('DOES_NOT_EXIST', source)
self.assertEqual(
'Incorrect provider config, missing env var DOES_NOT_EXIST, xyz',