provider/openstack: Support Import openstack_compute_floatingip_v2 (#7348)

This commit is contained in:
Joe Topjian 2016-07-03 09:38:38 -06:00 committed by Paul Stack
parent 0466520626
commit 713c0daa52
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package openstack
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccComputeV2FloatingIP_importBasic(t *testing.T) {
resourceName := "openstack_compute_floatingip_v2.foo"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeV2FloatingIPDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccComputeV2FloatingIP_basic,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"region"},
},
},
})
}

View File

@ -14,6 +14,9 @@ func resourceComputeFloatingIPV2() *schema.Resource {
Read: resourceComputeFloatingIPV2Read,
Update: nil,
Delete: resourceComputeFloatingIPV2Delete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"region": &schema.Schema{