mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Merge pull request #632 from ucc/python_3.9_compat
Fix _is_valid_dkim_key for Python 3.9 compatibility in OVH provider
This commit is contained in:
@@ -6,7 +6,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [2.7, 3.7]
|
||||
python-version: [2.7, 3.7, 3.9]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Setup python
|
||||
|
||||
@@ -370,11 +370,15 @@ class OvhProvider(BaseProvider):
|
||||
|
||||
@staticmethod
|
||||
def _is_valid_dkim_key(key):
|
||||
result = True
|
||||
base64_decode = getattr(base64, 'decodestring', None)
|
||||
base64_decode = getattr(base64, 'decodebytes', base64_decode)
|
||||
|
||||
try:
|
||||
base64.decodestring(bytearray(key, 'utf-8'))
|
||||
result = base64_decode(bytearray(key, 'utf-8'))
|
||||
except binascii.Error:
|
||||
return False
|
||||
return True
|
||||
result = False
|
||||
return result
|
||||
|
||||
def get_records(self, zone_name):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user