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

Make sure map and keys are lists when needed

This commit is contained in:
Ross McFarland
2019-10-07 09:31:15 -07:00
parent 7958233fcc
commit be06a5da94
2 changed files with 4 additions and 4 deletions

View File

@@ -903,10 +903,10 @@ class DynProvider(BaseProvider):
# Sort the values for consistent ordering so that we can compare
values = sorted(values, key=_dynamic_value_sort_key)
# Ensure that weight is included and if not use the default
values = map(lambda v: {
values = list(map(lambda v: {
'value': v['value'],
'weight': v.get('weight', 1),
}, values)
}, values))
# Walk through our existing pools looking for a match we can use
for pool in pools:

View File

@@ -670,8 +670,8 @@ class TestDynProviderGeo(TestCase):
tds = provider.traffic_directors
self.assertEquals(set(['unit.tests.', 'geo.unit.tests.']),
set(tds.keys()))
self.assertEquals(['A'], tds['unit.tests.'].keys())
self.assertEquals(['A'], tds['geo.unit.tests.'].keys())
self.assertEquals(['A'], list(tds['unit.tests.'].keys()))
self.assertEquals(['A'], list(tds['geo.unit.tests.'].keys()))
provider.log.warn.assert_called_with("Unsupported TrafficDirector "
"'%s'", 'something else')