Skip to content

Commit ae8e32d

Browse files
tjprescotttroydai
authored andcommitted
Fix issue #2752. (#4859)
1 parent d652c77 commit ae8e32d

File tree

3 files changed

+213
-216
lines changed

3 files changed

+213
-216
lines changed

src/command_modules/azure-cli-network/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Release History
88
* `dns`: Add support for CAA records.
99
* `traffic-manager profile update`: Fix issue where profiles with endpoints could not be updated.
1010
* `vnet update`: Fix issue where `--dns-servers` didn't work depending on how the VNET was created (ARM deployment).
11+
* `dns zone import`: Fix issue where relative names were incorrectly imported.
1112

1213
2.0.17
1314
++++++

src/command_modules/azure-cli-network/azure/cli/command_modules/network/custom.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,9 +2874,6 @@ def import_zone(resource_group_name, zone_name, file_name):
28742874
'imported at this time. Skipping...', relative_record_set_name)
28752875
continue
28762876

2877-
if record_set_type != 'soa' and relative_record_set_name != origin:
2878-
relative_record_set_name = record_set_name[:-(len(origin) + 2)]
2879-
28802877
record_set = RecordSet(ttl=record_set_ttl)
28812878
record_sets[record_set_key] = record_set
28822879
_add_record(record_set, record, record_set_type,
@@ -2898,7 +2895,7 @@ def import_zone(resource_group_name, zone_name, file_name):
28982895
for key, rs in record_sets.items():
28992896

29002897
rs_name, rs_type = key.lower().rsplit('.', 1)
2901-
rs_name = '@' if rs_name == origin else rs_name
2898+
rs_name = rs_name[:-(len(origin) + 1)] if rs_name != origin else '@'
29022899

29032900
try:
29042901
record_count = len(getattr(rs, _type_to_property_name(rs_type)))

0 commit comments

Comments
 (0)