diff options
author | Ritu Sood <ritu.sood@intel.com> | 2020-10-02 23:20:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-10-02 23:20:30 +0000 |
commit | a091f6dbab44a210a431f5a9ca4d48386444ad2c (patch) | |
tree | 226725537ae96eb77672e492e21f39c2ccc05cad /src/dcm/api/logicalCloudHandler.go | |
parent | 49f3d84b1dd20e7504018ee952d81885d5f21796 (diff) | |
parent | a1df0c268ffe34884b115fb3873c2d4ba6ad27b8 (diff) |
Merge "Reimplement Terminate to be compatible with Status"
Diffstat (limited to 'src/dcm/api/logicalCloudHandler.go')
-rw-r--r-- | src/dcm/api/logicalCloudHandler.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dcm/api/logicalCloudHandler.go b/src/dcm/api/logicalCloudHandler.go index 5bc2cd27..b305b202 100644 --- a/src/dcm/api/logicalCloudHandler.go +++ b/src/dcm/api/logicalCloudHandler.go @@ -188,6 +188,10 @@ func (h logicalCloudHandler) deleteHandler(w http.ResponseWriter, r *http.Reques http.Error(w, err.Error(), http.StatusNotFound) return } + if err.Error() == "The Logical Cloud can't be deleted yet, it is being terminated." { + http.Error(w, err.Error(), http.StatusConflict) + return + } http.Error(w, err.Error(), http.StatusInternalServerError) return } @@ -212,13 +216,6 @@ func (h logicalCloudHandler) applyHandler(w http.ResponseWriter, r *http.Request return } - _, ctxVal, err := h.client.GetLogicalCloudContext(project, name) - if ctxVal != "" { - err = pkgerrors.New("Logical Cloud already applied") - http.Error(w, err.Error(), http.StatusConflict) - return - } - // Get Clusters clusters, err := h.clusterClient.GetAllClusters(project, name) @@ -241,6 +238,10 @@ func (h logicalCloudHandler) applyHandler(w http.ResponseWriter, r *http.Request // Apply the Logical Cloud err = module.Apply(project, lc, clusters, quotas) if err != nil { + if err.Error() == "The Logical Cloud can't be re-applied yet, it is being terminated." { + http.Error(w, err.Error(), http.StatusConflict) + return + } http.Error(w, err.Error(), http.StatusInternalServerError) return } |