Resolve vf_module_id setting bug 70/71270/2
authorMarcus G K Williams <marcus.williams@intel.com>
Thu, 25 Oct 2018 18:56:43 +0000 (11:56 -0700)
committerMarcus G K Williams <marcus.williams@intel.com>
Thu, 25 Oct 2018 19:19:48 +0000 (12:19 -0700)
Do not remove vf_module_id and vnf_id
from parameters in HeatUtils.

Issue-ID: SO-1165
Change-Id: I6f00350a6f7dc419a8be9b90b28188228949cb43
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java

index 076e03b..8f71af4 100644 (file)
@@ -76,7 +76,7 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
     public static final String VF_MODULE_ID = "vf_module_id";
     public static final String TEMPLATE_TYPE = "template_type";
     public static final List<String> MULTICLOUD_INPUTS =
-            Arrays.asList(OOF_DIRECTIVES, SDNC_DIRECTIVES, GENERIC_VNF_ID, VF_MODULE_ID, TEMPLATE_TYPE);
+            Arrays.asList(OOF_DIRECTIVES, SDNC_DIRECTIVES, TEMPLATE_TYPE);
 
     private static final Logger logger = LoggerFactory.getLogger(MsoMulticloudUtils.class);
 
@@ -157,18 +157,29 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin{
 
         for (String key: MULTICLOUD_INPUTS) {
             if (!stackInputs.isEmpty() && stackInputs.containsKey(key)) {
-                if ( key == OOF_DIRECTIVES) {oofDirectives = (String) stackInputs.get(key);}
-                if ( key == SDNC_DIRECTIVES) {sdncDirectives = (String) stackInputs.get(key);}
-                if ( key == GENERIC_VNF_ID) {genericVnfId = (String) stackInputs.get(key);}
-                if ( key == VF_MODULE_ID) {vfModuleId = (String) stackInputs.get(key);}
-                if ( key == TEMPLATE_TYPE) {templateType = (String) stackInputs.get(key);}
-                         if (logger.isDebugEnabled()) {
+                if (key == OOF_DIRECTIVES) {
+                    oofDirectives = (String) stackInputs.get(key);
+                }
+                if (key == SDNC_DIRECTIVES) {
+                    sdncDirectives = (String) stackInputs.get(key);
+                }
+                if (key == TEMPLATE_TYPE) {
+                    templateType = (String) stackInputs.get(key);
+                }
+                if (logger.isDebugEnabled()) {
                     logger.debug(String.format("Found %s: %s", key, stackInputs.get(key)));
                 }
                 stackInputs.remove(key);
             }
         }
 
+        if (!stackInputs.isEmpty() && stackInputs.containsKey("VF_MODULE_ID")){
+            vfModuleId = (String) stackInputs.get("VF_MODULE_ID");
+        }
+        if (!stackInputs.isEmpty() && stackInputs.containsKey("GENERIC_VNF_ID")){
+            genericVnfId = (String) stackInputs.get("GENERIC_VNF_ID");
+        }
+
         // create the multicloud payload
         CreateStackParam stack = createStackParam(stackName, heatTemplate, stackInputs, timeoutMinutes, environment, files, heatFiles);