diff --git a/kombu/transport/azureservicebus.py b/kombu/transport/azureservicebus.py index 01de80a57..d913d3eaf 100644 --- a/kombu/transport/azureservicebus.py +++ b/kombu/transport/azureservicebus.py @@ -85,7 +85,6 @@ # dots are replaced by dash, all other punctuation replaced by underscore. PUNCTUATIONS_TO_REPLACE = set(string.punctuation) - {'_', '.', '-'} CHARS_REPLACE_TABLE = { - ord('.'): ord('-'), **{ord(c): ord('_') for c in PUNCTUATIONS_TO_REPLACE} } diff --git a/t/unit/transport/test_azureservicebus.py b/t/unit/transport/test_azureservicebus.py index 111eab68e..2109bf16e 100644 --- a/t/unit/transport/test_azureservicebus.py +++ b/t/unit/transport/test_azureservicebus.py @@ -358,9 +358,12 @@ def test_custom_entity_name(): conn = Connection(URL_CREDS_SAS, transport=azureservicebus.Transport) channel = conn.channel() - # dashes allowed and dots replaced by dashes + # dashes allowed assert channel.entity_name('test-celery') == 'test-celery' - assert channel.entity_name('test.celery') == 'test-celery' + + # dots allowed + # cf. https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules + assert channel.entity_name('test.celery') == 'test.celery' # all other punctuations replaced by underscores assert channel.entity_name('test_celery') == 'test_celery'