fix bug 555 Change extended pci validation schema for sdn port mapping 04/6604/3
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 2 Nov 2018 08:23:43 +0000 (09:23 +0100)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 2 Nov 2018 13:22:32 +0000 (14:22 +0100)
Change-Id: I9bd7b020988a440ba56e7014a008577bb64616ab
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_nbi/html_public/version
osm_nbi/validation.py

index 7416eba..23fb4a2 100644 (file)
@@ -1,2 +1,2 @@
-0.1.23
-2018-10-31
+0.1.24
+2018-11-02
index 861bc74..da3dd04 100644 (file)
@@ -25,6 +25,8 @@ null_schema = {"type": "null"}
 id_schema = {"type": "string", "pattern": "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"}
 time_schema = {"type": "string", "pattern": "^[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]([0-5]:){2}"}
 pci_schema = {"type": "string", "pattern": "^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\\.[0-9a-fA-F]$"}
+# allows [] for wildcards. For that reason huge length limit is set
+pci_extended_schema = {"type": "string", "pattern": "^[0-9a-fA-F.:-\\[\\]]{12,40}$"}
 http_schema = {"type": "string", "pattern": "^https?://[^'\"=]+$"}
 bandwidth_schema = {"type": "string", "pattern": "^[0-9]+ *([MG]bps)?$"}
 memory_schema = {"type": "string", "pattern": "^[0-9]+ *([MG]i?[Bb])?$"}
@@ -394,7 +396,7 @@ sdn_port_mapping_schema = {
                 "items": {
                     "type": "object",
                     "properties": {
-                        "pci": pci_schema,
+                        "pci": pci_extended_schema,
                         "switch_port": nameshort_schema,
                         "switch_mac": mac_schema
                     },