From e22a7d2738789f4d30934f9b388c2e60fec25bf6 Mon Sep 17 00:00:00 2001 From: Charles Durieux Date: Wed, 8 Jan 2020 17:45:02 +0100 Subject: [PATCH 1/2] Fix trailing semicolon in dkim for ovh provider Pulling dns records from ovh to a yaml file puts a semicolon at the end. Pushing from yaml to ovh will fail the "dkim-compliant" verification if there is an empty field (and there is one in case of a trailing semicolon). With the current logic, pulling dkim record created with ovh then pushing it back will NOT work. This small patch ignores all empty fields in a dkim records during dkim validation. --- octodns/provider/ovh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/ovh.py b/octodns/provider/ovh.py index 17aff8d..6bed788 100644 --- a/octodns/provider/ovh.py +++ b/octodns/provider/ovh.py @@ -323,7 +323,7 @@ class OvhProvider(BaseProvider): 'n': lambda _: True, 'g': lambda _: True} - splitted = value.split('\\;') + splitted = list(filter(None, value.split('\\;'))) found_key = False for splitted_value in splitted: sub_split = [x.strip() for x in splitted_value.split("=", 1)] From 4b625eba64f89c37b5ef5866de4d714f8134318b Mon Sep 17 00:00:00 2001 From: Kaari Date: Wed, 8 Jan 2020 19:52:13 +0100 Subject: [PATCH 2/2] Use comprehension for clarity and best practice Co-Authored-By: Ross McFarland --- octodns/provider/ovh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/ovh.py b/octodns/provider/ovh.py index 6bed788..8a3d492 100644 --- a/octodns/provider/ovh.py +++ b/octodns/provider/ovh.py @@ -323,7 +323,7 @@ class OvhProvider(BaseProvider): 'n': lambda _: True, 'g': lambda _: True} - splitted = list(filter(None, value.split('\\;'))) + splitted = [v for v in value.split('\\;') if v] found_key = False for splitted_value in splitted: sub_split = [x.strip() for x in splitted_value.split("=", 1)]