Skip to content

Commit

Permalink
[Network] Fix case sensitivity in DNS zone import. (#6603)
Browse files Browse the repository at this point in the history
* Fix #6602.

* Bump network version.
  • Loading branch information
tjprescott committed Jun 18, 2018
1 parent 3b4a58e commit 290d96d
Show file tree
Hide file tree
Showing 8 changed files with 546 additions and 542 deletions.
4 changes: 4 additions & 0 deletions src/command_modules/azure-cli-network/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

2.1.5
++++++
* `network dns zone import`: Fix issue where record types were case-sensitive. [#6602](https://github.com/Azure/azure-cli/issues/6602)

2.1.4
++++++
* `network lb probe create`: support `Https` protocol [#6571](https://github.com/Azure/azure-cli/issues/6571)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def test_zone_file_2(self):
self._check_mx(zone, 'aa.' + zn, [(300, 1, 'foo.com.' + zn)])
self._check_txt(zone, 'longtxt2.' + zn, [(100, 500, None)])
self._check_txt(zone, 'longtxt.' + zn, [(999, 944, None)])
self._check_txt(zone, 'spf.' + zn, [(100, None, 'this is an SPF record! Convert to TXT on import')]) # pylint: disable=line-too-long
self._check_txt(zone, 'myspf.' + zn, [(100, None, 'this is an SPF record! Convert to TXT on import')]) # pylint: disable=line-too-long
self._check_txt(zone, zn, [
(200, None, 'this is another SPF, this time as TXT'),
(200, None, 'v=spf1 mx ip4:14.14.22.0/23 a:mail.trum.ch mx:mese.ch include:spf.mapp.com ?all') # pylint: disable=line-too-long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ aa 100 A 4.5.6.7 ; A record
longtxt 999 TXT "this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer....this is a super long txt record...wow, it is really really long! And I even used copy and paste to make it longer...."
longtxt2 100 TXT "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"

spf 100 SPF "this is an SPF record! Convert to TXT on import"
myspf 100 SPF "this is an SPF record! Convert to TXT on import"
@ 200 TXT "this is another SPF, this time as TXT"

; PTR tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

; Exported zone file from Azure DNS
; Zone name: zone2.com
; Resource Group Name: cli_dns_zone2_importthin24ydqmjufm3nfejoaxrsocwa3snn4m3alkj7qaoj5srlz3nci2h
; Date and time (UTC): Mon, 02 Apr 2018 08:50:30 -0700
; Resource Group Name: cli_dns_zone2_import000001
; Date and time (UTC): Mon, 18 Jun 2018 13:22:52 -0700

$TTL 3600
$ORIGIN zone2.com.
Expand Down Expand Up @@ -68,9 +68,9 @@ longtxt2 100 IN TXT "01234567890123456789012345678901234567890123456789012345678
mail 3600 IN MX 10 mail1.mymail.com.
3600 IN MX 11 flooble.

spaces 3600 IN TXT " a "
myspf 100 IN TXT "this is an SPF record! Convert to TXT on import"

spf 100 IN TXT "this is an SPF record! Convert to TXT on import"
spaces 3600 IN TXT " a "

t1 3600 IN TXT "foobar"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
100 IN NS ns1 ; Auth NS record should import TTL only

; Check $TTL is observed
$TTL 300
$ttl 300
ttl-300 IN A 10.1.2.3 ; Should have TTL 300

$TTL 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def _parse_record(parser, record_token):
record_type = None
for i in range(3):
try:
if record_token[i] in SUPPORTED_RECORDS:
record_type = record_token[i]
if record_token[i].upper() in SUPPORTED_RECORDS:
record_type = record_token[i].upper()
break
except KeyError:
break
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-network/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "2.1.4"
VERSION = "2.1.5"
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 290d96d

Please sign in to comment.