-
Sub-task
-
Resolution: Done
-
Medium
-
None
-
None
Problem : We were passing the list of only existing Module References (eliminating the new ones from the list) which is in turn used to insert schema set yang resources.
Fix : Pass all the module references and no need to discard the new ones from the list.
Possible Changes :
org/onap/cps/ncmp/api/inventory/sync/ModuleSyncService.java#syncAndCreateSchemaSetAndAnchor -->
existing : createSchemaSetAndAnchor(yangModelCmHandle, newModuleNameToContentMap, existingModuleReferencesFromCmHandle);
new : createSchemaSetAndAnchor(yangModelCmHandle, newModuleNameToContentMap, allModuleReferencesFromCmHandle); // similar logic change as per the intention
Also have a check in org/onap/cps/spi/repository/YangResourceNativeRepositoryImpl.java#getResourceIdsByModuleReferences to return an empty list of ids if there are no module references to prevent the SQL Error: 0, SQLState: 02000"