0
0
mirror of https://github.com/thegeeklab/corenetworks.git synced 2024-06-02 16:59:41 +02:00

ensure CNAME records could not mixed with other types using the same name

This commit is contained in:
Robert Kaussow 2020-05-11 22:23:13 +02:00
parent e3dce0340f
commit a332423c45
2 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,2 @@
* ENHANCEMENT
* make `ttl` mandatory for add function
* add `requests` to requirements
* BUGFIX
* update (delete + create) records with different `ttl` to prevent duplicate entries
* add a workaround to prevent CNAME creation if a record with the same name already exists
* extend the workaround to ensure CNAME records could not mixed with other types using the same name

View File

@ -209,8 +209,9 @@ class CoreNetworks():
if params["name"] == "@":
raise CorenetworksError("CNAME records are not allowed for the zone itself.")
records = self.records(zone, params={"name": params["name"]})
for r in records:
records = self.records(zone, params={"name": params["name"]})
for r in records:
if params["type"] == "CNAME" or r["type"] == "CNAME":
raise CorenetworksError(
"A record with the same name already exist ({name}). "
"CNAME records cannot use the same name with other records.".format(