Fix import policy issues
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / csar / YamlTemplateParsingHandler.java
index 3171277..9734a0a 100644 (file)
@@ -91,6 +91,7 @@ import org.openecomp.sdc.be.components.impl.ImportUtils;
 import org.openecomp.sdc.be.components.impl.NodeFilterUploadCreator;
 import org.openecomp.sdc.be.components.impl.PolicyTypeBusinessLogic;
 import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException;
+import org.openecomp.sdc.be.components.utils.PropertiesUtils;
 import org.openecomp.sdc.be.config.BeEcompErrorManager;
 import org.openecomp.sdc.be.dao.api.ActionStatus;
 import org.openecomp.sdc.be.dao.janusgraph.JanusGraphDao;
@@ -367,11 +368,15 @@ public class YamlTemplateParsingHandler {
                 }
                 final UploadPropInfo uploadPropInfo = buildProperty(propertyJson.getKey(), propertyJson.getValue());
                 final PropertyDefinition propertyDefinition = new PropertyDefinition(originalProperty);
-                propertyDefinition.setValue(gson.toJson(uploadPropInfo.getValue()));
                 propertyDefinition.setToscaFunction(uploadPropInfo.getToscaFunction());
                 propertyDefinition.setSubPropertyToscaFunctions(uploadPropInfo.getSubPropertyToscaFunctions());
                 propertyDefinition.setGetInputValues(uploadPropInfo.getGet_input());
                 propertyDefinition.setDescription(uploadPropInfo.getDescription());
+                String propertyValue = gson.toJson(uploadPropInfo.getValue());
+                if (!propertyDefinition.isToscaFunction()) {
+                    propertyValue = PropertiesUtils.trimQuotes(propertyValue);
+                }
+                propertyDefinition.setValue(propertyValue);
                 return propertyDefinition;
             })
             .filter(Objects::nonNull)