mirror of
https://github.com/thegeeklab/corenetworks.git
synced 2024-11-24 20:10:40 +00:00
ensure CNAME records could not mixed with other types using the same name
This commit is contained in:
parent
e3dce0340f
commit
a332423c45
@ -1,6 +1,2 @@
|
|||||||
* ENHANCEMENT
|
|
||||||
* make `ttl` mandatory for add function
|
|
||||||
* add `requests` to requirements
|
|
||||||
* BUGFIX
|
* BUGFIX
|
||||||
* update (delete + create) records with different `ttl` to prevent duplicate entries
|
* extend the workaround to ensure CNAME records could not mixed with other types using the same name
|
||||||
* add a workaround to prevent CNAME creation if a record with the same name already exists
|
|
||||||
|
@ -209,8 +209,9 @@ class CoreNetworks():
|
|||||||
if params["name"] == "@":
|
if params["name"] == "@":
|
||||||
raise CorenetworksError("CNAME records are not allowed for the zone itself.")
|
raise CorenetworksError("CNAME records are not allowed for the zone itself.")
|
||||||
|
|
||||||
records = self.records(zone, params={"name": params["name"]})
|
records = self.records(zone, params={"name": params["name"]})
|
||||||
for r in records:
|
for r in records:
|
||||||
|
if params["type"] == "CNAME" or r["type"] == "CNAME":
|
||||||
raise CorenetworksError(
|
raise CorenetworksError(
|
||||||
"A record with the same name already exist ({name}). "
|
"A record with the same name already exist ({name}). "
|
||||||
"CNAME records cannot use the same name with other records.".format(
|
"CNAME records cannot use the same name with other records.".format(
|
||||||
|
Loading…
Reference in New Issue
Block a user