From 3cc0fac817023e8d22f1d69146ccfe8bea00f5d4 Mon Sep 17 00:00:00 2001 From: blanariu Date: Thu, 24 Jun 2021 12:39:56 +0300 Subject: [PATCH] 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' --- octodns/manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/octodns/manager.py b/octodns/manager.py index 9b10196..dcae0a7 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -243,7 +243,8 @@ class Manager(object): try: source.populate(zone, lenient=lenient) except TypeError as e: - if "keyword argument 'lenient'" not in text_type(e): + if ("unexpected keyword argument 'lenient'" + not in text_type(e)): raise self.log.warn(': provider %s does not accept lenient ' 'param', source.__class__.__name__)