From 42fce59a553debba41506932e1c42d0578324656 Mon Sep 17 00:00:00 2001 From: tierno Date: Fri, 2 Nov 2018 09:23:43 +0100 Subject: [PATCH] fix bug 555 Change extended pci validation schema for sdn port mapping Change-Id: I9bd7b020988a440ba56e7014a008577bb64616ab Signed-off-by: tierno --- osm_nbi/html_public/version | 4 ++-- osm_nbi/validation.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osm_nbi/html_public/version b/osm_nbi/html_public/version index 7416eba..23fb4a2 100644 --- a/osm_nbi/html_public/version +++ b/osm_nbi/html_public/version @@ -1,2 +1,2 @@ -0.1.23 -2018-10-31 +0.1.24 +2018-11-02 diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 861bc74..da3dd04 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -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 }, -- 2.25.1