Slipped in, shouldn't be here...

This commit is contained in:
Sander van Harmelen 2015-04-12 10:56:59 +02:00
parent d678b79fce
commit e2e7ee6d75
1 changed files with 2 additions and 1 deletions

View File

@ -167,6 +167,7 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{})
// Wait until the template is ready to use, or timeout with an error... // Wait until the template is ready to use, or timeout with an error...
currentTime := time.Now().Unix() currentTime := time.Now().Unix()
timeout := int64(d.Get("is_ready_timeout").(int))
for { for {
err := resourceCloudStackTemplateRead(d, meta) err := resourceCloudStackTemplateRead(d, meta)
if err != nil { if err != nil {
@ -177,7 +178,7 @@ func resourceCloudStackTemplateCreate(d *schema.ResourceData, meta interface{})
return nil 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") return fmt.Errorf("Timeout while waiting for template to become ready")
} }
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)