Add mapping for vm_type_tag 99/46899/1
authorTimoney, Dan (dt5972) <dt5972@att.com>
Wed, 9 May 2018 20:27:29 +0000 (16:27 -0400)
committerTimoney, Dan (dt5972) <dt5972@att.com>
Wed, 9 May 2018 20:27:29 +0000 (16:27 -0400)
If vm_type is not found in CSAR, use vm_type_tag value instead.

Change-Id: Ifd73029446d465aad2d9d995559be837f29b97a4
Issue-ID: SDNC-305
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncVFCModel.java

index d7ed19e..a3345c1 100644 (file)
@@ -8,9 +8,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,19 +28,22 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class SdncVFCModel extends SdncBaseModel {
-       
+
        private static final Logger LOG = LoggerFactory
                        .getLogger(SdncVFCModel.class);
-       
+
        private String vmType = null;
        private String vmCount = null;
 
        public SdncVFCModel(ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate) {
 
                super(sdcCsarHelper, nodeTemplate);
-               
+
                // extract properties
                vmType = extractValue (nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPE);
+               if ((vmType == null) || (vmType.length() == 0)) {
+                       vmType = extractValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMTYPETAG);
+               }
                //vmCount = extractValue (sdcCsarHelper, nodeTemplate, SdcPropertyNames.PROPERTY_NAME_VMCOUNT); - need path to vm_count
                vmCount = "1";
                addParameter("vm_type", vmType);