aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/apply.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/pkg/module/apply.go
parent2573d840571cb511e27ba5ef663a4b99bc717a45 (diff)
parent5e013d0d327dee9f5cd53fee6ec8d2d2593e0258 (diff)
Merge "Restore commented unit test TestDeleteLogicalCloud"
Diffstat (limited to 'src/dcm/pkg/module/apply.go')
-rw-r--r--src/dcm/pkg/module/apply.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dcm/pkg/module/apply.go b/src/dcm/pkg/module/apply.go
index c3378ab8..0eaa75ab 100644
--- a/src/dcm/pkg/module/apply.go
+++ b/src/dcm/pkg/module/apply.go
@@ -342,11 +342,11 @@ func Apply(project string, logicalcloud LogicalCloud, clusterList []Cluster,
}
// Check if there was a previous context for this logical cloud
- ac, cid, err := lcclient.GetLogicalCloudContext(project, logicalCloudName)
+ ac, cid, err := lcclient.util.GetLogicalCloudContext(lcclient.storeName, lckey, lcclient.tagMeta, project, logicalCloudName)
if cid != "" {
// Make sure rsync status for this logical cloud is Terminated,
// otherwise we can't re-apply logical cloud yet
- acStatus, _ := getAppContextStatus(ac)
+ acStatus, _ := lcclient.util.GetAppContextStatus(ac)
switch acStatus.Status {
case appcontext.AppContextStatusEnum.Terminated:
// We now know Logical Cloud has terminated, so let's update the entry before we process the apply
@@ -544,8 +544,12 @@ func Terminate(project string, logicalcloud LogicalCloud, clusterList []Cluster,
logicalCloudName := logicalcloud.MetaData.LogicalCloudName
lcclient := NewLogicalCloudClient()
+ lckey := LogicalCloudKey{
+ LogicalCloudName: logicalcloud.MetaData.LogicalCloudName,
+ Project: project,
+ }
- ac, cid, err := lcclient.GetLogicalCloudContext(project, logicalCloudName)
+ ac, cid, err := lcclient.util.GetLogicalCloudContext(lcclient.storeName, lckey, lcclient.tagMeta, project, logicalCloudName)
if err != nil {
return pkgerrors.Wrapf(err, "Logical Cloud doesn't seem applied: %v", logicalCloudName)
}
@@ -554,7 +558,7 @@ func Terminate(project string, logicalcloud LogicalCloud, clusterList []Cluster,
if cid != "" {
// Make sure rsync status for this logical cloud is Terminated,
// otherwise we can't re-apply logical cloud yet
- acStatus, _ := getAppContextStatus(ac)
+ acStatus, _ := lcclient.util.GetAppContextStatus(ac)
switch acStatus.Status {
case appcontext.AppContextStatusEnum.Terminated:
return pkgerrors.New("The Logical Cloud has already been terminated: " + logicalCloudName)