mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-20 04:00:40 -04:00
Merge pull request #1957 from jtopjian/openstack-volume-fixes
provider/openstack: Minor volume fixes
This commit is contained in:
@@ -53,6 +53,7 @@ func resourceBlockStorageVolumeV1() *schema.Resource {
|
||||
Type: schema.TypeMap,
|
||||
Optional: true,
|
||||
ForceNew: false,
|
||||
Computed: true,
|
||||
},
|
||||
"snapshot_id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
|
||||
@@ -209,7 +209,6 @@ func resourceComputeInstanceV2() *schema.Resource {
|
||||
Schema: map[string]*schema.Schema{
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
"volume_id": &schema.Schema{
|
||||
@@ -955,7 +954,6 @@ func resourceComputeVolumeAttachmentHash(v interface{}) int {
|
||||
var buf bytes.Buffer
|
||||
m := v.(map[string]interface{})
|
||||
buf.WriteString(fmt.Sprintf("%s-", m["volume_id"].(string)))
|
||||
buf.WriteString(fmt.Sprintf("%s-", m["device"].(string)))
|
||||
return hashcode.String(buf.String())
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ func TestAccComputeV2Instance_basic(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func _TestAccComputeV2Instance_volumeAttach(t *testing.T) {
|
||||
func TestAccComputeV2Instance_volumeAttach(t *testing.T) {
|
||||
var instance servers.Server
|
||||
var volume volumes.Volume
|
||||
|
||||
@@ -229,6 +229,7 @@ var testAccComputeV2Instance_volumeAttach = fmt.Sprintf(`
|
||||
resource "openstack_compute_instance_v2" "foo" {
|
||||
region = "%s"
|
||||
name = "terraform-test"
|
||||
security_groups = ["default"]
|
||||
volume {
|
||||
volume_id = "${openstack_blockstorage_volume_v1.myvol.id}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user