aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/api/logicalCloudHandler.go
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-10-16 23:25:49 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-16 23:25:49 +0000
commitf192f46107c86d3e15e9fb889e2e4382e26e94e3 (patch)
treebe944d97cf01aa3f04fec151026e1e1fbe96e636 /src/dcm/api/logicalCloudHandler.go
parent2573d840571cb511e27ba5ef663a4b99bc717a45 (diff)
parent5e013d0d327dee9f5cd53fee6ec8d2d2593e0258 (diff)
Merge "Restore commented unit test TestDeleteLogicalCloud"
Diffstat (limited to 'src/dcm/api/logicalCloudHandler.go')
-rw-r--r--src/dcm/api/logicalCloudHandler.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/dcm/api/logicalCloudHandler.go b/src/dcm/api/logicalCloudHandler.go
index b305b202..ad9a3807 100644
--- a/src/dcm/api/logicalCloudHandler.go
+++ b/src/dcm/api/logicalCloudHandler.go
@@ -26,7 +26,6 @@ import (
"github.com/gorilla/mux"
"github.com/onap/multicloud-k8s/src/dcm/pkg/module"
orch "github.com/onap/multicloud-k8s/src/orchestrator/pkg/module"
- pkgerrors "github.com/pkg/errors"
)
// logicalCloudHandler is used to store backend implementations objects
@@ -266,13 +265,6 @@ func (h logicalCloudHandler) terminateHandler(w http.ResponseWriter, r *http.Req
return
}
- _, ctxVal, err := h.client.GetLogicalCloudContext(project, name)
- if ctxVal == "" {
- err = pkgerrors.New("Logical Cloud hasn't been applied yet")
- http.Error(w, err.Error(), http.StatusConflict)
- return
- }
-
// Get Clusters
clusters, err := h.clusterClient.GetAllClusters(project, name)
@@ -291,8 +283,11 @@ func (h logicalCloudHandler) terminateHandler(w http.ResponseWriter, r *http.Req
// Terminate the Logical Cloud
err = module.Terminate(project, lc, clusters, quotas)
if err != nil {
+ if err.Error() == "Logical Cloud doesn't seem applied: "+name {
+ http.Error(w, err.Error(), http.StatusConflict)
+ return
+ }
http.Error(w, err.Error(), http.StatusInternalServerError)
- return
}
return