Browse Source

Make sure map and keys are lists when needed

pull/384/head
Ross McFarland 6 years ago
parent
commit
be06a5da94
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      octodns/provider/dyn.py
  2. +2
    -2
      tests/test_octodns_provider_dyn.py

+ 2
- 2
octodns/provider/dyn.py 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:


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


Loading…
Cancel
Save