Skip to content

Commit

Permalink
fix azure service bus isinstance check
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwbarnett committed Jul 10, 2024
1 parent 4fb7246 commit 06b8c10
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions kombu/transport/azureservicebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,13 @@ def _try_parse_connection_string(self) -> None:
self._namespace, self._credential = Transport.parse_uri(
self.conninfo.hostname)

if (isinstance(self._credential, DefaultAzureCredential) or
isinstance(self._credential, ManagedIdentityCredential)):
if (
DefaultAzureCredential is not None
and isinstance(self._credential, DefaultAzureCredential)
) or (
ManagedIdentityCredential is not None
and isinstance(self._credential, ManagedIdentityCredential)
):
return None

if ":" in self._credential:
Expand Down Expand Up @@ -470,7 +475,7 @@ def parse_uri(uri: str) -> tuple[str, str | DefaultAzureCredential |
if not all([namespace, credential]):
raise ValueError(
'Need a URI like '
'azureservicebus://{SAS policy name}:{SAS key}@{ServiceBus Namespace} ' # noqa
'azureservicebus://{SAS policy name}:{SAS key}@{ServiceBus Namespace} ' # noqa
'or the azure Endpoint connection string'
)

Expand Down

0 comments on commit 06b8c10

Please sign in to comment.