diff options
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 } |