Fix 'Import use case fails when interfaces in template do not exist in system'-bug...
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / servlets / AbstractValidationsServlet.java
index ade8637..5875664 100644 (file)
@@ -659,13 +659,13 @@ public abstract class AbstractValidationsServlet extends BeGenericServlet {
         if (CsarValidationUtils.isCsarPayloadName(resourceInfoObject.getPayloadName())) {
             log.debug("import resource from csar");
             importedResourceStatus = importResourceFromUICsar(resourceInfoObject, user, resourceUniqueId);
-        } else if (!authority.isUserTypeResource()) {
-            log.debug("import normative type resource");
-            createOrUpdateResponse =
-                resourceImportManager.importNormativeResource(yamlAsString, resourceInfoObject, user, createNewVersion, true, false);
-        } else {
+        } else if (authority.isUserTypeResource()) {
             log.debug("import user resource (not normative type)");
             createOrUpdateResponse = resourceImportManager.importUserDefinedResource(yamlAsString, resourceInfoObject, user, false);
+        } else {
+            log.debug("import normative type resource");
+            createOrUpdateResponse =
+                resourceImportManager.importNormativeResource(yamlAsString, resourceInfoObject, null, user, createNewVersion, true, false);
         }
         if (createOrUpdateResponse != null) {
             importedResourceStatus = createOrUpdateResponse;