summaryrefslogtreecommitdiff
path: root/libvirt/resource_cloud_init.go
diff options
context:
space:
mode:
authorAlvaro Saurin <alvaro.saurin@gmail.com>2016-10-17 16:24:42 +0200
committerAlvaro Saurin <alvaro.saurin@gmail.com>2016-10-17 16:24:42 +0200
commit7852fba9e8071f29ae715894b70070b2defeefce (patch)
treee63d8d8cdac8c5528f7276dc57aa58709135b8b8 /libvirt/resource_cloud_init.go
parent72645e7a26b7f9352573db813f65b42edc53d148 (diff)
downloadterraform-provider-libvirt-7852fba9e8071f29ae715894b70070b2defeefce.tar
terraform-provider-libvirt-7852fba9e8071f29ae715894b70070b2defeefce.tar.gz
Make sure we record the resource IDs even if it gets interrupted
Diffstat (limited to 'libvirt/resource_cloud_init.go')
-rw-r--r--libvirt/resource_cloud_init.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libvirt/resource_cloud_init.go b/libvirt/resource_cloud_init.go
index 14522d2d..5f14e354 100644
--- a/libvirt/resource_cloud_init.go
+++ b/libvirt/resource_cloud_init.go
@@ -65,6 +65,13 @@ func resourceCloudInitCreate(d *schema.ResourceData, meta interface{}) error {
}
d.SetId(key)
+ // make sure we record the id even if the rest of this gets interrupted
+ d.Partial(true) // make sure we record the id even if the rest of this gets interrupted
+ d.Set("id", key)
+ d.SetPartial("id")
+ // TODO: at this point we have collected more things than the ID, so let's save as many things as we can
+ d.Partial(false)
+
return resourceCloudInitRead(d, meta)
}