1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Description: Fix regex to create floating PTR.
Author: Axel Jacquet <axel.jacquet@infomaniak.com>
Forwarded: no
Last-Update: 2024-06-27
--- designate-18.0.0.orig/designate/api/v2/controllers/floatingips.py
+++ designate-18.0.0/designate/api/v2/controllers/floatingips.py
@@ -15,6 +15,7 @@
# under the License.
from oslo_log import log as logging
import pecan
+import re
from designate.api.v2.controllers import rest
from designate.common import constants
@@ -25,9 +26,13 @@ from designate.objects.adapters import D
LOG = logging.getLogger(__name__)
-def fip_key_to_data(key):
- m = constants.RE_FIP.match(key)
+FIP_REGEX = ('^(?P<region>[A-Za-z0-9\\.\\-_]{1,100}):'
+ '(?P<id>[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'
+ '[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$')
+def fip_key_to_data(key):
+ # m = constants.RE_FIP.match(key)
+ m = re.match(FIP_REGEX, key)
# NOTE: Ensure that the fip matches region:floatingip_id or raise, if
# not this will cause a 500.
if m is None:
|