From 7485ee04efbf76d9d611a9001e2abfdfc529d576 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Mon, 5 Nov 2012 23:27:49 +0800 Subject: [PATCH] Use uuidutils.is_uuid_like in quantum.extentions.l3 Change-Id: I82e42aebd45d743ed890190e478294531f7db4e6 --- quantum/extensions/l3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quantum/extensions/l3.py b/quantum/extensions/l3.py index 6afd2e193e..f7e0e35c73 100644 --- a/quantum/extensions/l3.py +++ b/quantum/extensions/l3.py @@ -67,7 +67,7 @@ class ExternalNetworkInUse(qexception.InUse): def _validate_uuid_or_none(data, valid_values=None): if data is None: return None - return attr._validate_regex(data, attr.UUID_PATTERN) + return attr._validate_uuid(data) attr.validators['type:uuid_or_none'] = _validate_uuid_or_none @@ -75,7 +75,7 @@ attr.validators['type:uuid_or_none'] = _validate_uuid_or_none RESOURCE_ATTRIBUTE_MAP = { 'routers': { 'id': {'allow_post': False, 'allow_put': False, - 'validate': {'type:regex': attr.UUID_PATTERN}, + 'validate': {'type:uuid': None}, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'is_visible': True, 'default': ''}, @@ -98,7 +98,7 @@ RESOURCE_ATTRIBUTE_MAP = { 'floating_ip_address': {'allow_post': False, 'allow_put': False, 'is_visible': True}, 'floating_network_id': {'allow_post': True, 'allow_put': False, - 'validate': {'type:regex': attr.UUID_PATTERN}, + 'validate': {'type:uuid': None}, 'is_visible': True}, 'router_id': {'allow_post': False, 'allow_put': False, 'is_visible': True, 'default': None},