Browse Source

Merge branch 'master' into related-proj-docs

pull/674/head
Ross McFarland 5 years ago
committed by GitHub
parent
commit
571b707d63
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions
  1. +4
    -1
      octodns/provider/base.py
  2. +7
    -0
      octodns/provider/powerdns.py

+ 4
- 1
octodns/provider/base.py View File

@ -91,7 +91,10 @@ class BaseProvider(BaseSource):
self.log.info('apply: disabled') self.log.info('apply: disabled')
return 0 return 0
self.log.info('apply: making changes')
zone_name = plan.desired.name
num_changes = len(plan.changes)
self.log.info('apply: making %d changes to %s', num_changes,
zone_name)
self._apply(plan) self._apply(plan)
return len(plan.changes) return len(plan.changes)


+ 7
- 0
octodns/provider/powerdns.py View File

@ -6,6 +6,7 @@ from __future__ import absolute_import, division, print_function, \
unicode_literals unicode_literals
from requests import HTTPError, Session from requests import HTTPError, Session
from operator import itemgetter
import logging import logging
from ..record import Create, Record from ..record import Create, Record
@ -381,6 +382,12 @@ class PowerDnsBaseProvider(BaseProvider):
for change in changes: for change in changes:
class_name = change.__class__.__name__ class_name = change.__class__.__name__
mods.append(getattr(self, '_mod_{}'.format(class_name))(change)) mods.append(getattr(self, '_mod_{}'.format(class_name))(change))
# Ensure that any DELETE modifications always occur before any REPLACE
# modifications. This ensures that an A record can be replaced by a
# CNAME record and vice-versa.
mods.sort(key=itemgetter('changetype'))
self.log.debug('_apply: sending change request') self.log.debug('_apply: sending change request')
try: try:


Loading…
Cancel
Save