summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ModelBusinessLogic.java2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java3
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java1
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java2
4 files changed, 7 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ModelBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ModelBusinessLogic.java
index 6eb806d3d1..de79ec165d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ModelBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ModelBusinessLogic.java
@@ -50,7 +50,7 @@ public class ModelBusinessLogic {
}
public Model createModel(final Model model) {
- LOGGER.debug("createModel: creating model {}", model);
+ LOGGER.debug("creating model {}", model);
return modelOperation.createModel(model, false);
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
index 2956abfe1b..c0c68d6c47 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java
@@ -2451,6 +2451,9 @@ public class ServiceImportBusinessLogic {
if (CollectionUtils.isEmpty(newResource.getProperties())) {
newResource.setProperties(oldResource.getProperties());
}
+ if (newResource.getModel() == null) {
+ newResource.setModel(oldResource.getModel());
+ }
}
protected Map<String, Resource> createResourcesFromYamlNodeTypesList(String yamlName, Service service, Map<String, Object> mappedToscaTemplate,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
index 706f7a7304..32a63dcc46 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/UiComponentDataConverter.java
@@ -445,6 +445,7 @@ public class UiComponentDataConverter {
dataTransfer.setMetadata(metadata);
dataTransfer.setDerivedFromGenericType(service.getDerivedFromGenericType());
dataTransfer.setDerivedFromGenericVersion(service.getDerivedFromGenericVersion());
+ dataTransfer.setModel(service.getModel());
break;
case NODE_FILTER:
if (service.getNodeFilterComponents() == null) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
index bdc9ffce43..e7966e0d08 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ResourceUploadServlet.java
@@ -123,6 +123,7 @@ public class ResourceUploadServlet extends AbstractValidationsServlet {
commonGeneralValidations(responseWrapper, userWrapper, uploadResourceInfoWrapper, resourceAuthorityEnum, userId, resourceInfoJsonString);
final String modelNameToBeAssociated = uploadResourceInfoWrapper.getInnerElement().getModel();
if (modelNameToBeAssociated != null) {
+ log.debug("Model Name to be validated {}", modelNameToBeAssociated);
validateModel(modelNameToBeAssociated);
}
fillPayload(responseWrapper, uploadResourceInfoWrapper, yamlStringWrapper, userWrapper.getInnerElement(), resourceInfoJsonString,
@@ -155,6 +156,7 @@ public class ResourceUploadServlet extends AbstractValidationsServlet {
*/
private void validateModel(final String modelName) {
if (modelBusinessLogic.findModel(modelName).isEmpty()) {
+ log.error("Could not find model name {}", modelName);
throw ModelOperationExceptionSupplier.invalidModel(modelName).get();
}
}