Skip to content

Commit 1ced477

Browse files
Copilotxiangyan99
andcommitted
Fix pylint line-too-long and trailing-whitespace errors in AzureCliCredential
Co-authored-by: xiangyan99 <[email protected]>
1 parent eb3eb89 commit 1ced477

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

sdk/identity/azure-identity/azure/identity/_credentials/azure_cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def get_token(
102102
:param str scopes: desired scope for the access token. This credential allows only one scope per request.
103103
For more information about scopes, see
104104
https://learn.microsoft.com/entra/identity-platform/scopes-oidc.
105-
:keyword str claims: additional claims required in the token. This credential does not support claims challenges.
105+
:keyword str claims: additional claims required in the token. This credential does not support claims
106+
challenges.
106107
:keyword str tenant_id: optional tenant to include in the token request.
107108
108109
:return: An access token with the desired scopes.
@@ -146,8 +147,9 @@ def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptions] =
146147
"""
147148
claims_value = options.get("claims") if options else None
148149
if claims_value and claims_value.strip():
149-
raise CredentialUnavailableError(f"Fail to get token, please run az login --claims-challenge {claims_value}")
150-
150+
raise CredentialUnavailableError(
151+
f"Fail to get token, please run az login --claims-challenge {claims_value}"
152+
)
151153
return self._get_token_base(*scopes, options=options)
152154

153155
def _get_token_base(

sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_cli.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ async def get_token(
9494
:param str scopes: desired scope for the access token. This credential allows only one scope per request.
9595
For more information about scopes, see
9696
https://learn.microsoft.com/entra/identity-platform/scopes-oidc.
97-
:keyword str claims: additional claims required in the token. This credential does not support claims challenges.
97+
:keyword str claims: additional claims required in the token. This credential does not support claims
98+
challenges.
9899
:keyword str tenant_id: optional tenant to include in the token request.
99100
100101
:return: An access token with the desired scopes.
@@ -106,7 +107,7 @@ async def get_token(
106107
"""
107108
if claims and claims.strip():
108109
raise CredentialUnavailableError(f"Fail to get token, please run az login --claims-challenge {claims}")
109-
110+
110111
# only ProactorEventLoop supports subprocesses on Windows (and it isn't the default loop on Python < 3.8)
111112
if sys.platform.startswith("win") and not isinstance(asyncio.get_event_loop(), asyncio.ProactorEventLoop):
112113
return _SyncAzureCliCredential().get_token(*scopes, tenant_id=tenant_id, **kwargs)
@@ -141,8 +142,9 @@ async def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptio
141142
"""
142143
claims_value = options.get("claims") if options else None
143144
if claims_value and claims_value.strip():
144-
raise CredentialUnavailableError(f"Fail to get token, please run az login --claims-challenge {claims_value}")
145-
145+
raise CredentialUnavailableError(
146+
f"Fail to get token, please run az login --claims-challenge {claims_value}"
147+
)
146148
# only ProactorEventLoop supports subprocesses on Windows (and it isn't the default loop on Python < 3.8)
147149
if sys.platform.startswith("win") and not isinstance(asyncio.get_event_loop(), asyncio.ProactorEventLoop):
148150
return _SyncAzureCliCredential().get_token_info(*scopes, options=options)

0 commit comments

Comments
 (0)