From af8998a2699dab87ff00c82cdf28e1a44517d9e7 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Mon, 2 Nov 2020 22:26:29 +0100 Subject: [PATCH] Version 3.4.5 --- CHANGELOG.md | 2 ++ lexicon/providers/cloudflare.py | 13 +++++++------ lexicon/providers/godaddy.py | 21 +++++++++++++++------ pyproject.toml | 2 +- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6433dd621..7924293c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## master - CURRENT + +## 3.4.5 - 02/11/2020 ### Added * Add pagination support to Google Cloud DNS provider (#577) * Add official support to Python 3.9 diff --git a/lexicon/providers/cloudflare.py b/lexicon/providers/cloudflare.py index 01c4942fd..d46bfc0d3 100644 --- a/lexicon/providers/cloudflare.py +++ b/lexicon/providers/cloudflare.py @@ -68,7 +68,12 @@ def _authenticate(self): # Create record. If record already exists with the same content, do nothing' def _create_record(self, rtype, name, content): content, cf_data = self._format_content(rtype, content) - data = {"type": rtype, "name": self._full_name(name), "content": content, "data": cf_data} + data = { + "type": rtype, + "name": self._full_name(name), + "content": content, + "data": cf_data, + } if self._get_lexicon_option("ttl"): data["ttl"] = self._get_lexicon_option("ttl") @@ -220,11 +225,7 @@ def _format_content(self, rtype, content): # fields that make up the record seperately, then the API joins # them back together _fp = content.split(" ") - data = { - "algorithm": _fp[0], - "type": _fp[1], - "fingerprint": _fp[2] - } + data = {"algorithm": _fp[0], "type": _fp[1], "fingerprint": _fp[2]} content = None return content, data diff --git a/lexicon/providers/godaddy.py b/lexicon/providers/godaddy.py index f2c02f325..0b8df4d51 100644 --- a/lexicon/providers/godaddy.py +++ b/lexicon/providers/godaddy.py @@ -94,7 +94,9 @@ def _create_record(self, rtype, name, content): ttl = self._get_lexicon_option("ttl") # Retrieve existing data in DNS zone. - records = self._get("/domains/{0}/records/{1}/{2}".format(domain, rtype, relative_name)) + records = self._get( + "/domains/{0}/records/{1}/{2}".format(domain, rtype, relative_name) + ) # Check if a record already matches given parameters for record in records: @@ -112,7 +114,9 @@ def _create_record(self, rtype, name, content): records.append(data) # Insert the record - self._put("/domains/{0}/records/{1}/{2}".format(domain, rtype, relative_name), records) + self._put( + "/domains/{0}/records/{1}/{2}".format(domain, rtype, relative_name), records + ) LOGGER.debug("create_record: %s %s %s", rtype, name, content) @@ -159,11 +163,16 @@ def _update_record(self, identifier, rtype=None, name=None, content=None): # Synchronize data with updated records into DNS zone. if updated_record is not None: - if identifier and self._relative_name(updated_record['name']) != relative_name: - self._put('/domains/{0}/records/{1}'.format(domain, rtype), records) + if ( + identifier + and self._relative_name(updated_record["name"]) != relative_name + ): + self._put("/domains/{0}/records/{1}".format(domain, rtype), records) else: - self._put('/domains/{0}/records/{1}/{2}'.format(domain, rtype, relative_name), - updated_record) + self._put( + "/domains/{0}/records/{1}/{2}".format(domain, rtype, relative_name), + updated_record, + ) LOGGER.debug("update_record: %s %s %s", rtype, name, content) diff --git a/pyproject.toml b/pyproject.toml index f5e1c5ba3..8b38dfe3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "dns-lexicon" -version = "3.4.4" +version = "3.4.5" description = "Manipulate DNS records on various DNS providers in a standardized/agnostic way" license = "MIT" keywords = [