From a887d789578c8cedf7bd427ff4e25f039000001f Mon Sep 17 00:00:00 2001 From: wanghao Date: Mon, 5 Jun 2017 16:17:30 +0800 Subject: [PATCH] Support dot character in queue's name Now Zaqar doesn't support '.' in queue name. This feature will introduce the support for this. Change-Id: Id698f043c0b1bc50567aba149e2235d9443bc105 Closes-Bug: #1695848 --- .../notes/support-dot-in-queue-name-bd2b3d523f55451f.yaml | 3 +++ zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py | 4 ++++ zaqar/transport/validation.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/support-dot-in-queue-name-bd2b3d523f55451f.yaml diff --git a/releasenotes/notes/support-dot-in-queue-name-bd2b3d523f55451f.yaml b/releasenotes/notes/support-dot-in-queue-name-bd2b3d523f55451f.yaml new file mode 100644 index 000000000..96ee69e74 --- /dev/null +++ b/releasenotes/notes/support-dot-in-queue-name-bd2b3d523f55451f.yaml @@ -0,0 +1,3 @@ +--- +features: + - Support dot character in queue's name, like 'service.test_queue'. diff --git a/zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py b/zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py index e3f25e0f9..75a1a5a54 100644 --- a/zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py +++ b/zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py @@ -136,6 +136,10 @@ class TestQueueLifecycleMongoDB(base.V2Base): headers=self.headers) self.assertEqual(falcon.HTTP_400, self.srmock.status) + self.simulate_put(self.queue_path + '/Service.test_queue', + headers=self.headers) + self.assertEqual(falcon.HTTP_201, self.srmock.status) + def test_project_id_restriction(self): muvluv_queue_path = self.queue_path + '/Muv-Luv' diff --git a/zaqar/transport/validation.py b/zaqar/transport/validation.py index 9d003c498..97d8a8470 100644 --- a/zaqar/transport/validation.py +++ b/zaqar/transport/validation.py @@ -91,7 +91,7 @@ _TRANSPORT_LIMITS_GROUP = 'transport' # NOTE(kgriffs): Don't use \w because it isn't guaranteed to match # only ASCII characters. -QUEUE_NAME_REGEX = re.compile('^[a-zA-Z0-9_\-]+$') +QUEUE_NAME_REGEX = re.compile('^[a-zA-Z0-9_\-.]+$') QUEUE_NAME_MAX_LEN = 64 PROJECT_ID_MAX_LEN = 256