types: CredentialsConfiguration.conf can return None

This commit is contained in:
Alex Zorin
2023-04-16 10:43:00 +10:00
parent 4740e20725
commit 5503d12395
11 changed files with 34 additions and 24 deletions
@@ -3,6 +3,7 @@ import logging
import re
from typing import Any
from typing import Callable
from typing import cast
from typing import Optional
from typing import Union
@@ -61,7 +62,7 @@ class Authenticator(dns_common.DNSAuthenticator):
def _get_linode_client(self) -> '_LinodeLexiconClient':
if not self.credentials: # pragma: no cover
raise errors.Error("Plugin has not been prepared.")
api_key = self.credentials.conf('key')
api_key = cast(str,self.credentials.conf('key'))
api_version: Optional[Union[str, int]] = self.credentials.conf('version')
if api_version == '':
api_version = None