diff --git a/mso/resource_mso_site.go b/mso/resource_mso_site.go index 12688c21..82e83608 100644 --- a/mso/resource_mso_site.go +++ b/mso/resource_mso_site.go @@ -62,7 +62,6 @@ func resourceMSOSite() *schema.Resource { "location": &schema.Schema{ Type: schema.TypeMap, Optional: true, - Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -103,7 +102,6 @@ func resourceMSOSite() *schema.Resource { "maintenance_mode": &schema.Schema{ Type: schema.TypeBool, Optional: true, - Computed: true, Default: false, }, diff --git a/mso/util.go b/mso/util.go index aeb7d78d..d8f93913 100644 --- a/mso/util.go +++ b/mso/util.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/ciscoecosystem/mso-go-client/container" + "github.com/ciscoecosystem/mso-go-client/models" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -21,7 +22,7 @@ func toStringList(configured interface{}) []string { func errorForObjectNotFound(err error, dn string, con *container.Container, d *schema.ResourceData) error { if err != nil { - if con.S("code").String() == "404" || strings.HasSuffix(err.Error(), "not found") { + if con.S("code").String() == "404" || strings.HasSuffix(err.Error(), "not found") || strings.HasSuffix(models.StripQuotes(con.S("error").String()), "no documents in result") { log.Printf("[WARN] %s, removing from state: %s", err, dn) d.SetId("") return nil