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

Merge remote-tracking branch 'origin' into missing-dots-processor

This commit is contained in:
Ross McFarland
2024-03-11 14:54:17 -07:00
4 changed files with 28 additions and 5 deletions

View File

@@ -1,7 +1,13 @@
## v1.?.? - 2024-??-?? -
## v1.6.x - 2024-??-?? - ???
* Add EnsureTrailingDots processor
## 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

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'

View File

@@ -388,10 +388,14 @@ class Manager(object):
f'Incorrect provider config, missing env var {env_var}, {source.context}'
)
try:
# try converting the value to a number to see if it
# converts
v = float(v)
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

View File

@@ -1133,6 +1133,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({}))
@@ -1202,6 +1203,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',
}
),
)
class TestMainThreadExecutor(TestCase):
def test_success(self):