Merge pull request #5566 from stack72/triton-wait-for-image-creation

builder/triton: Wait for ImageCreation State
This commit is contained in:
James Nugent 2017-11-08 08:44:59 -06:00 committed by GitHub
commit 61f8cbbd1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -4,9 +4,8 @@ import (
"context" "context"
"errors" "errors"
"net/http" "net/http"
"time"
"sort" "sort"
"time"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/joyent/triton-go/client" "github.com/joyent/triton-go/client"
@ -200,7 +199,7 @@ func (d *driverTriton) WaitForImageCreation(imageId string, timeout time.Duratio
if image == nil { if image == nil {
return false, err return false, err
} }
return image.OS != "", err return image.State == "active", err
}, },
3*time.Second, 3*time.Second,
timeout, timeout,