diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 726e2e8..f8b37ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/octodns/provider/ovh.py b/octodns/provider/ovh.py index 54f62ac..9f7cd9a 100644 --- a/octodns/provider/ovh.py +++ b/octodns/provider/ovh.py @@ -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): """