Merge "Bug 637 NSD-level IP Profiles not working in mgmt-network fix single for loop... feature7106
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 4 Apr 2019 14:07:55 +0000 (16:07 +0200)
committerGerrit Code Review <root@osm.etsi.org>
Thu, 4 Apr 2019 14:07:55 +0000 (16:07 +0200)
osm_nbi/descriptor_topics.py

index 9f022f4..a1c3c15 100644 (file)
@@ -687,6 +687,10 @@ class NsdTopic(DescriptorTopic):
         # Cross references validation in the descriptor
         # TODO validata that if contains cloud-init-file or charms, have artifacts _admin.storage."pkg-dir" is not none
         for vld in get_iterable(indata.get("vld")):
+            if vld.get("mgmt-network") and vld.get("ip-profile-ref"):
+                raise EngineException("Error at vld[id='{}']:ip-profile-ref"
+                                      " You cannot set an ip-profile when mgmt-network is True"
+                                      .format(vld["id"]), http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
             for vnfd_cp in get_iterable(vld.get("vnfd-connection-point-ref")):
                 for constituent_vnfd in get_iterable(indata.get("constituent-vnfd")):
                     if vnfd_cp["member-vnf-index-ref"] == constituent_vnfd["member-vnf-index"]: