Browse Source

more consistent naming, pural secrets

pull/1140/head
Ross McFarland 2 years ago
parent
commit
b539cb0a4f
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
4 changed files with 8 additions and 8 deletions
  1. +3
    -3
      octodns/secret/environ.py
  2. +1
    -1
      octodns/secret/exception.py
  3. +2
    -2
      tests/test_octodns_manager.py
  4. +2
    -2
      tests/test_octodns_secret_environ.py

+ 3
- 3
octodns/secret/environ.py 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:


+ 1
- 1
octodns/secret/exception.py View File

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

+ 2
- 2
tests/test_octodns_manager.py 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))


+ 2
- 2
tests/test_octodns_secret_environ.py 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',


Loading…
Cancel
Save