mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-26 15:24:17 +00:00
Change domain(s) to zone(s) in the python code and docs
This commit is contained in:
@@ -21,7 +21,7 @@ class StructuredException(Exception):
|
||||
class DomainNotExists(StructuredException):
|
||||
status_code = 404
|
||||
|
||||
def __init__(self, name=None, message="Domain does not exist"):
|
||||
def __init__(self, name=None, message="Zone does not exist"):
|
||||
StructuredException.__init__(self)
|
||||
self.message = message
|
||||
self.name = name
|
||||
@@ -30,7 +30,7 @@ class DomainNotExists(StructuredException):
|
||||
class DomainAlreadyExists(StructuredException):
|
||||
status_code = 409
|
||||
|
||||
def __init__(self, name=None, message="Domain already exists"):
|
||||
def __init__(self, name=None, message="Zone already exists"):
|
||||
StructuredException.__init__(self)
|
||||
self.message = message
|
||||
self.name = name
|
||||
@@ -39,7 +39,7 @@ class DomainAlreadyExists(StructuredException):
|
||||
class DomainAccessForbidden(StructuredException):
|
||||
status_code = 403
|
||||
|
||||
def __init__(self, name=None, message="Domain access not allowed"):
|
||||
def __init__(self, name=None, message="Zone access not allowed"):
|
||||
StructuredException.__init__(self)
|
||||
self.message = message
|
||||
self.name = name
|
||||
@@ -47,7 +47,7 @@ class DomainAccessForbidden(StructuredException):
|
||||
class DomainOverrideForbidden(StructuredException):
|
||||
status_code = 409
|
||||
|
||||
def __init__(self, name=None, message="Domain override of record not allowed"):
|
||||
def __init__(self, name=None, message="Zone override of record not allowed"):
|
||||
StructuredException.__init__(self)
|
||||
self.message = message
|
||||
self.name = name
|
||||
@@ -67,7 +67,7 @@ class ApiKeyNotUsable(StructuredException):
|
||||
def __init__(
|
||||
self,
|
||||
name=None,
|
||||
message=("Api key must have domains or accounts"
|
||||
message=("Api key must have zones or accounts"
|
||||
" or an administrative role")):
|
||||
StructuredException.__init__(self)
|
||||
self.message = message
|
||||
|
@@ -229,7 +229,7 @@ def ensure_list(l):
|
||||
|
||||
def pretty_domain_name(domain_name):
|
||||
# Add a debugging statement to print out the domain name
|
||||
print("Received domain name:", domain_name)
|
||||
print("Received zone name:", domain_name)
|
||||
|
||||
# Check if the domain name is encoded using Punycode
|
||||
if domain_name.endswith('.xn--'):
|
||||
@@ -238,9 +238,9 @@ def pretty_domain_name(domain_name):
|
||||
domain_name = idna.decode(domain_name)
|
||||
except Exception as e:
|
||||
# If the decoding fails, raise an exception with more information
|
||||
raise Exception('Cannot decode IDN domain: {}'.format(e))
|
||||
raise Exception('Cannot decode IDN zone: {}'.format(e))
|
||||
|
||||
# Return the "pretty" version of the domain name
|
||||
# Return the "pretty" version of the zone name
|
||||
return domain_name
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user