From 2a740bcf4989db7663a79e7798080be6fc630eed Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 9 Oct 2024 14:58:41 -0700 Subject: [PATCH] port --- .../azure-eventhub/azure/eventhub/_pyamqp/_connection.py | 3 ++- .../azure/eventhub/_pyamqp/aio/_connection_async.py | 3 ++- .../azure-servicebus/azure/servicebus/_pyamqp/_connection.py | 3 ++- .../azure/servicebus/_pyamqp/aio/_connection_async.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py index 1a57d5f6cb57..7a1a79ebc750 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py @@ -118,7 +118,8 @@ def __init__( # pylint:disable=too-many-locals,too-many-statements self._hostname = parsed_url.hostname kwargs["http_proxy"] = http_proxy endpoint = self._hostname - if parsed_url.port: + if parsed_url.port and not kwargs.get("use_tls"): + # if we are using an emulator, use the port passed in url self._port = parsed_url.port elif parsed_url.scheme == "amqps": self._port = SECURE_PORT diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py index 16a0bd9a79e7..d4d29ec074eb 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py @@ -99,7 +99,8 @@ def __init__(# pylint:disable=too-many-locals,too-many-statements self._hostname = parsed_url.hostname kwargs["http_proxy"] = http_proxy endpoint = self._hostname - if parsed_url.port: + if parsed_url.port and not kwargs.get("use_tls"): + # if we are using an emulator, use the port passed in url self._port = parsed_url.port elif parsed_url.scheme == "amqps": self._port = SECURE_PORT diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py index 1a57d5f6cb57..7a1a79ebc750 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py @@ -118,7 +118,8 @@ def __init__( # pylint:disable=too-many-locals,too-many-statements self._hostname = parsed_url.hostname kwargs["http_proxy"] = http_proxy endpoint = self._hostname - if parsed_url.port: + if parsed_url.port and not kwargs.get("use_tls"): + # if we are using an emulator, use the port passed in url self._port = parsed_url.port elif parsed_url.scheme == "amqps": self._port = SECURE_PORT diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py index 16a0bd9a79e7..d4d29ec074eb 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py @@ -99,7 +99,8 @@ def __init__(# pylint:disable=too-many-locals,too-many-statements self._hostname = parsed_url.hostname kwargs["http_proxy"] = http_proxy endpoint = self._hostname - if parsed_url.port: + if parsed_url.port and not kwargs.get("use_tls"): + # if we are using an emulator, use the port passed in url self._port = parsed_url.port elif parsed_url.scheme == "amqps": self._port = SECURE_PORT