Browse Source

Merge pull request #1224 from octodns/deprecate-legacy-param-handling

Deprecate Source.populate and Provider.plan legacy param/api fallbacks
pull/1226/head
Ross McFarland 1 year ago
committed by GitHub
parent
commit
54d2e0f19b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions
  1. +4
    -0
      CHANGELOG.md
  2. +10
    -1
      octodns/manager.py

+ 4
- 0
CHANGELOG.md View File

@ -1,5 +1,9 @@
## v1.?.? - 2024-??-?? - ???
* Deprecation warning for Source.populate w/o the lenient param, to be removed
in 2.x
* Deprecation warning for Provider.populate w/o the processors param, to be
removed in 2.x
* Add YamlProvider.order_mode to allow picking between natural (human)
the default when enforce_order=True and simple `sort`.


+ 10
- 1
octodns/manager.py View File

@ -13,6 +13,7 @@ from logging import getLogger
from sys import stdout
from . import __version__
from .deprecation import deprecated
from .idna import IdnaDict, idna_decode, idna_encode
from .processor.arpa import AutoArpa
from .processor.meta import MetaProcessor
@ -509,6 +510,10 @@ class Manager(object):
except TypeError as e:
if "unexpected keyword argument 'lenient'" not in str(e):
raise
deprecated(
f'`populate` method does not support the `lenient` param, fallback is DEPRECATED. Will be removed in 2.0. Class {source.__class__.__name__}',
stacklevel=99,
)
self.log.warning(
'provider %s does not accept lenient param',
source.__class__.__name__,
@ -527,6 +532,10 @@ class Manager(object):
except TypeError as e:
if "keyword argument 'processors'" not in str(e):
raise
deprecated(
f'`plan` method does not support the `processors` param, fallback is DEPRECATED. Will be removed in 2.0. Class {target.__class__.__name__}',
stacklevel=99,
)
self.log.warning(
'provider.plan %s does not accept processors param',
target.__class__.__name__,
@ -568,7 +577,7 @@ class Manager(object):
sources = collected
except KeyError:
raise ManagerException(
f'Zone {decoded_zone_name}, unknown ' f'source: {source}'
f'Zone {decoded_zone_name}, unknown source: {source}'
)
return sources


Loading…
Cancel
Save