Skip to content

Commit f7d7251

Browse files
copyright update
1 parent 5161c1d commit f7d7251

5 files changed

Lines changed: 17 additions & 25 deletions

File tree

examples/zone-export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2026 NSONE, Inc.
2+
# Copyright IBM Corp. 2026
33
#
44
# License under The MIT License (MIT). See LICENSE in project root.
55
#

ns1/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2025 NSONE, Inc.
2+
# Copyright IBM Corp. 2014, 2026
33
#
44
# License under The MIT License (MIT). See LICENSE in project root.
55
#

ns1/rest/zones.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014 NSONE, Inc.
2+
# Copyright IBM Corp. 2014, 2026
33
#
44
# License under The MIT License (MIT). See LICENSE in project root.
55
#
@@ -225,27 +225,13 @@ def get_zonefile_export(self, zone, callback=None, errback=None):
225225
:param str zone: zone name
226226
:return: zone file content as string
227227
"""
228-
# Note: This endpoint returns raw zone file text, not JSON
229-
# The transport layer will try to parse it as JSON and fail
230-
# We catch that exception and extract the raw body text
231-
try:
232-
return self._make_request(
233-
"GET",
234-
f"export/zonefile/{zone}",
235-
callback=callback,
236-
errback=errback,
237-
)
238-
except ResourceException as e:
239-
# Check if this is a valid zonefile response (plain text)
240-
# The response should be 200 OK with text/plain content
241-
if e.response and e.response.getcode() == 200:
242-
# Check content-type header for text/plain
243-
content_type = e.response.getheader("Content-Type", "")
244-
if "text/plain" in content_type or "text" in content_type:
245-
# This is the expected plain text zonefile
246-
return e.body if e.body else ""
247-
# Otherwise, this is a real error - re-raise it
248-
raise
228+
return self._make_request(
229+
"GET",
230+
f"export/zonefile/{zone}",
231+
callback=callback,
232+
errback=errback,
233+
skip_json_parsing=True,
234+
)
249235

250236

251237
# successive pages just extend the list of zones

ns1/zones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014 NSONE, Inc.
2+
# Copyright IBM Corp. 2014, 2026
33
#
44
# License under The MIT License (MIT). See LICENSE in project root.
55
#

tests/unit/test_zone.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# Copyright IBM Corp. 2014, 2026
3+
#
4+
# License under The MIT License (MIT). See LICENSE in project root.
5+
#
6+
17
import ns1.rest.zones
28
import pytest
39
import os

0 commit comments

Comments
 (0)