1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Forcing delete to happen before create

This commit is contained in:
Arunothia Marappan
2020-07-16 16:41:53 -07:00
parent 2e8691e77f
commit 4e056d315d

View File

@@ -497,6 +497,10 @@ class AzureProvider(BaseProvider):
azure_zone_name = desired.name[:len(desired.name) - 1]
self._check_zone(azure_zone_name, create=True)
# Force the operation order to be Update() -> Delete() -> Create()
# This will help avoid problems in updating a CNAME record into an A record.
changes.reverse()
for change in changes:
class_name = change.__class__.__name__
getattr(self, '_apply_{}'.format(class_name))(change)