summaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/logicalcloud.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/dcm/pkg/module/logicalcloud.go')
-rw-r--r--src/dcm/pkg/module/logicalcloud.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dcm/pkg/module/logicalcloud.go b/src/dcm/pkg/module/logicalcloud.go
index 9b8ff703..61d7b7a5 100644
--- a/src/dcm/pkg/module/logicalcloud.go
+++ b/src/dcm/pkg/module/logicalcloud.go
@@ -199,7 +199,12 @@ func (v *LogicalCloudClient) Delete(project, logicalCloudName string) error {
Project: project,
LogicalCloudName: logicalCloudName,
}
- err := v.util.DBRemove(v.storeName, key)
+ //Check if this Logical Cloud exists
+ _, err := v.Get(project, logicalCloudName)
+ if err != nil {
+ return pkgerrors.New("Logical Cloud does not exist")
+ }
+ err = v.util.DBRemove(v.storeName, key)
if err != nil {
return pkgerrors.Wrap(err, "Delete Logical Cloud")
}