Browse Source

Merge remote-tracking branch 'origin/main' into secrets

pull/1140/head
Ross McFarland 2 years ago
parent
commit
ec9c3bcc29
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
4 changed files with 32 additions and 1 deletions
  1. +6
    -0
      CHANGELOG.md
  2. +1
    -1
      octodns/__init__.py
  3. +12
    -0
      octodns/manager.py
  4. +13
    -0
      tests/test_octodns_manager.py

+ 6
- 0
CHANGELOG.md View File

@ -2,6 +2,12 @@
* Beta support for custom secret providers added to Manager.
## v1.5.1 - 2024-03-08 - env/* type conversion fix
* Improved env variable to parameter type conversion logic, avoid converting
all numbers to float which caused some formatting issues in things that
weren't being careful enough.
## v1.5.0 - 2024-02-26 - Checksums, nested expansion, & flexable values
* Beta support for Manager.enable_checksum and octodns-sync --checksum Allows a


+ 1
- 1
octodns/__init__.py View File

@ -1,4 +1,4 @@
'OctoDNS: DNS as code - Tools for managing DNS across multiple providers'
# TODO: remove __VERSION__ w/2.x
__version__ = __VERSION__ = '1.5.0'
__version__ = __VERSION__ = '1.5.1'

+ 12
- 0
octodns/manager.py View File

@ -434,6 +434,18 @@ class Manager(object):
else:
v = handler.fetch(name, source)
if isinstance(v, str):
try:
if '.' in v:
# has a dot, try converting it to a float
v = float(v)
else:
# no dot, try converting it to an int
v = int(v)
except ValueError:
# just leave it as a string
pass
kwargs[k] = v
return kwargs


+ 13
- 0
tests/test_octodns_manager.py View File

@ -1137,6 +1137,7 @@ class TestManager(TestCase):
environ['OCTODNS_TEST_1'] = '42'
environ['OCTODNS_TEST_2'] = 'string'
environ['OCTODNS_TEST_3'] = '43.44'
# empty
self.assertEqual({}, manager._build_kwargs({}))
@ -1206,6 +1207,18 @@ class TestManager(TestCase):
),
)
# types/conversion
self.assertEqual(
{'int': 42, 'string': 'string', 'float': 43.44},
manager._build_kwargs(
{
'int': 'env/OCTODNS_TEST_1',
'string': 'env/OCTODNS_TEST_2',
'float': 'env/OCTODNS_TEST_3',
}
),
)
def test_config_secret_handlers(self):
# config doesn't matter here
manager = Manager(get_config_filename('simple.yaml'))


Loading…
Cancel
Save