Browse Source

Enforcing Delete to happen before all other operations in _apply

pull/587/head
Arunothia Marappan 5 years ago
parent
commit
949a136f53
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      octodns/provider/azuredns.py

+ 9
- 4
octodns/provider/azuredns.py View File

@ -488,10 +488,15 @@ 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 Delete() before Create()
# Helps avoid problems in updating a CNAME record into an A record.
changes.reverse()
# Force the operation order to be Delete() before all other operations.
# Helps avoid problems in updating a CNAME record into an A record and vice-versa.
for change in changes:
class_name = change.__class__.__name__
getattr(self, '_apply_{}'.format(class_name))(change)
if class_name == 'Delete':
getattr(self, '_apply_{}'.format(class_name))(change)
for change in changes:
class_name = change.__class__.__name__
if class_name != 'Delete':
getattr(self, '_apply_{}'.format(class_name))(change)

Loading…
Cancel
Save