Browse Source

Fix bug in Manager when using Python 2.7

In Python 2.7 the if statement would catch both cases from the test
test_populate_lenient_fallback, so the test was failing. These are
the error strings differences between Python 2 and 3:

Python 2:
NoLenient: populate() got an unexpected keyword argument 'lenient'
NoZone: populate() got multiple values for keyword argument 'lenient'

Python 3:
NoLenient: populate() got an unexpected keyword argument 'lenient'
NoZone: populate() got multiple values for argument 'lenient'
pull/732/head
blanariu 5 years ago
parent
commit
3cc0fac817
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      octodns/manager.py

+ 2
- 1
octodns/manager.py View File

@ -243,7 +243,8 @@ class Manager(object):
try: try:
source.populate(zone, lenient=lenient) source.populate(zone, lenient=lenient)
except TypeError as e: except TypeError as e:
if "keyword argument 'lenient'" not in text_type(e):
if ("unexpected keyword argument 'lenient'"
not in text_type(e)):
raise raise
self.log.warn(': provider %s does not accept lenient ' self.log.warn(': provider %s does not accept lenient '
'param', source.__class__.__name__) 'param', source.__class__.__name__)


Loading…
Cancel
Save