From e2e7ee6d75ede7c659aa14763b8f77dd06da0f60 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Sun, 12 Apr 2015 10:56:59 +0200 Subject: [PATCH] Slipped in, shouldn't be here... --- builtin/providers/cloudstack/resource_cloudstack_template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/providers/cloudstack/resource_cloudstack_template.go b/builtin/providers/cloudstack/resource_cloudstack_template.go index 486ee87e9..4469f2d3f 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_template.go +++ b/builtin/providers/cloudstack/resource_cloudstack_template.go @@ -167,6 +167,7 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{}) // Wait until the template is ready to use, or timeout with an error... currentTime := time.Now().Unix() + timeout := int64(d.Get("is_ready_timeout").(int)) for { err := resourceCloudStackTemplateRead(d, meta) if err != nil { @@ -177,7 +178,7 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{}) return nil } - if time.Now().Unix()-currentTime > d.Get("is_ready_timeout").(int) { + if time.Now().Unix()-currentTime > timeout { return fmt.Errorf("Timeout while waiting for template to become ready") } time.Sleep(5 * time.Second)