aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-core
diff options
context:
space:
mode:
authorJian Huang <huang.jian12@zte.com.cn>2016-10-26 07:20:40 +0000
committerGerrit Code Review <gerrit@open-o.org>2016-10-26 07:20:40 +0000
commite0843a440ee94126b29f06484bc400ae2c47b4ea (patch)
treebf59c753ba7469ebffc775284d9556f00b3cbd6d /catalog-core
parent48388cdb84d98801e4e6e86c8d1fc0e4164e5c37 (diff)
parent985972be48f916fb79898f9a8afa698b7078ed30 (diff)
Merge "To delete the SubstitutionMapping Information when delete a csar package." into sun
Diffstat (limited to 'catalog-core')
-rw-r--r--catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java
index 43e70919..8a882533 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java
@@ -30,6 +30,8 @@ import org.openo.commontosca.catalog.entity.response.PackageMeta;
import org.openo.commontosca.catalog.entity.response.UploadPackageResponse;
import org.openo.commontosca.catalog.filemanage.FileManagerFactory;
import org.openo.commontosca.catalog.model.parser.ModelParserFactory;
+import org.openo.commontosca.catalog.model.service.ModelService;
+import org.openo.commontosca.catalog.resources.CatalogBadRequestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -227,18 +229,25 @@ public class PackageWrapper {
}
FileManagerFactory.createFileManager().delete(packagePath);
// delete template data from db
- PackageData packageData = new PackageData();
- packageData.setCsarId(csarId);
try {
- TemplateManager.getInstance().deleteServiceTemplateByCsarPackageInfo(packageData);
- } catch (CatalogResourceException e2) {
- LOG.error("delete template data from db error! csarId = " + csarId);
+ ModelService.getInstance().delete(csarId);
+ } catch (CatalogBadRequestException e) {
+ LOG.error("delete template data from db error! csarId = " + csarId, e);
+ } catch (CatalogResourceException e) {
+ LOG.error("delete template data from db error! csarId = " + csarId, e);
}
+// PackageData packageData = new PackageData();
+// packageData.setCsarId(csarId);
+// try {
+// TemplateManager.getInstance().deleteServiceTemplateByCsarPackageInfo(packageData);
+// } catch (CatalogResourceException e2) {
+// LOG.error("delete template data from db error! csarId = " + csarId);
+// }
//delete package data from database
try {
PackageManager.getInstance().deletePackage(csarId);
} catch (CatalogResourceException e1) {
- LOG.error("delete package by csarId from db error ! " + e1.getMessage());
+ LOG.error("delete package by csarId from db error ! " + e1.getMessage(), e1);
}
}