@@ -37,7 +37,7 @@ async def close(self) -> None:
37
37
async def _acquire_token_silently (self , * scopes : str , ** kwargs : Any ) -> Optional [AccessTokenInfo ]:
38
38
return self ._client .get_cached_token (* scopes )
39
39
40
- async def _request_token (self , * scopes : str , ** kwargs : Any ) -> AccessTokenInfo : # pylint:disable=unused-argument
40
+ async def _request_token (self , * scopes : str , ** kwargs : Any ) -> AccessTokenInfo :
41
41
42
42
if within_credential_chain .get () and not self ._endpoint_available :
43
43
# If within a chain (e.g. DefaultAzureCredential), we do a quick check to see if the IMDS endpoint
@@ -49,7 +49,7 @@ async def _request_token(self, *scopes: str, **kwargs: Any) -> AccessTokenInfo:
49
49
# IMDS responded
50
50
_check_forbidden_response (ex )
51
51
self ._endpoint_available = True
52
- except Exception as ex : # pylint:disable=broad-except
52
+ except Exception as ex :
53
53
error_message = (
54
54
"ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint."
55
55
)
@@ -78,7 +78,7 @@ async def _request_token(self, *scopes: str, **kwargs: Any) -> AccessTokenInfo:
78
78
_check_forbidden_response (ex )
79
79
# any other error is unexpected
80
80
raise ClientAuthenticationError (message = ex .message , response = ex .response ) from ex
81
- except Exception as ex : # pylint:disable=broad-except
81
+ except Exception as ex :
82
82
# if anything else was raised, assume the endpoint is unavailable
83
83
error_message = "ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint."
84
84
raise CredentialUnavailableError (error_message ) from ex
0 commit comments