1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Fix _is_valid_dkim_key for Python 3.9 compatibility in OVH provider

base64.decodestring was deprecated and removed in Python 3.9 in favour of
decodebytes (See https://bugs.python.org/issue39351 )
This commit is contained in:
Mark Tearle
2020-11-25 22:28:35 +08:00
parent 07b8c19acc
commit fa266c23d2

View File

@@ -370,11 +370,16 @@ class OvhProvider(BaseProvider):
@staticmethod
def _is_valid_dkim_key(key):
result = True
try:
base64.decodestring(bytearray(key, 'utf-8'))
decode = base64.decodestring
except AttributeError:
decode = base64.decodebytes
try:
result = decode(bytearray(key, 'utf-8'))
except binascii.Error:
return False
return True
result = False
return result
def get_records(self, zone_name):
"""