mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/openstack: gophercloud migration: util
This commit is contained in:
parent
74f990ff5c
commit
e677eaac6b
@ -3,14 +3,14 @@ package openstack
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/gophercloud/gophercloud"
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/rackspace/gophercloud"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so,
|
// CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so,
|
||||||
// sets the resource ID to the empty string instead of throwing an error.
|
// sets the resource ID to the empty string instead of throwing an error.
|
||||||
func CheckDeleted(d *schema.ResourceData, err error, msg string) error {
|
func CheckDeleted(d *schema.ResourceData, err error, msg string) error {
|
||||||
errCode, ok := err.(*gophercloud.UnexpectedResponseCodeError)
|
errCode, ok := err.(*gophercloud.ErrUnexpectedResponseCode)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("%s: %s", msg, err)
|
return fmt.Errorf("%s: %s", msg, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user