Skip to content

Commit

Permalink
[ignore] Modify URL for getting deployment status and Adjust conditio…
Browse files Browse the repository at this point in the history
…ns for deployment status.
  • Loading branch information
gmicol authored and lhercot committed Oct 3, 2024
1 parent 6e4726e commit d47c982
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mso/resource_mso_schema_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func resourceMSOSchemaSiteDelete(d *schema.ResourceData, m interface{}) error {
templateName := d.Get("template_name").(string)

if d.Get("undeploy_on_destroy").(bool) {
req, err := msoClient.MakeRestRequest("GET", fmt.Sprintf("mso/api/v1/deploy/status/schema/%s/template/%s", schemaId, templateName), nil, true)
req, err := msoClient.MakeRestRequest("GET", fmt.Sprintf("api/v1/deploy/status/schema/%s/template/%s", schemaId, templateName), nil, true)
if err != nil {
log.Printf("[DEBUG] MakeRestRequest failed with err: %s.", err)
return err
Expand All @@ -217,9 +217,9 @@ func resourceMSOSchemaSiteDelete(d *schema.ResourceData, m interface{}) error {
return err
}
if deployMap, ok := obj.Data().(map[string]interface{}); ok {
if statusList, ok := deployMap["status"].([]map[string]interface{}); ok && len(statusList) > 0 {
if statusList, ok := deployMap["status"].([]interface{}); ok && len(statusList) > 0 {
for _, statusMap := range statusList {
if statusMap["siteId"] == siteId && statusMap["status"].(map[string]interface{})["siteStatus"] == "Succeeded" {
if statusMap.(map[string]interface{})["siteId"] == siteId && statusMap.(map[string]interface{})["status"].(map[string]interface{})["siteStatus"] == "Succeeded" {
versionInt, err := msoClient.CompareVersion("3.7.0.0")
if versionInt == -1 {
payload, err := container.ParseJSON([]byte(fmt.Sprintf(`{"schemaId": "%s", "templateName": "%s", "undeploy": ["%s"]}`, schemaId, templateName, siteId)))
Expand Down

0 comments on commit d47c982

Please sign in to comment.