From: tierno Date: Fri, 2 Nov 2018 08:23:43 +0000 (+0100) Subject: fix bug 555 Change extended pci validation schema for sdn port mapping X-Git-Tag: v5.0.0~21 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=commitdiff_plain;h=42fce59a553debba41506932e1c42d0578324656;hp=ef4e224eb67d7b6711206591b8e1b5f8790c694e fix bug 555 Change extended pci validation schema for sdn port mapping Change-Id: I9bd7b020988a440ba56e7014a008577bb64616ab Signed-off-by: tierno --- 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 },