File: fix-regex-to-create-floating-ptr.patch

package info (click to toggle)
designate 1%3A21.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,860 kB
  • sloc: python: 49,608; sh: 1,914; sql: 155; makefile: 83; javascript: 3
file content (31 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (3)
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: