diff --git a/builder/googlecompute/driver_gce.go b/builder/googlecompute/driver_gce.go index 92ca0ab3d..38d68c9b7 100644 --- a/builder/googlecompute/driver_gce.go +++ b/builder/googlecompute/driver_gce.go @@ -141,7 +141,7 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) { } errCh := make(chan error, 1) - go waitForState(errCh, "DONE", d.refreshZoneOp(op)) + go waitForState(errCh, "DONE", d.refreshZoneOp(zone.Name, op)) return errCh, nil } @@ -162,9 +162,9 @@ func (d *driverGCE) getImage(name string) (image *compute.Image, err error) { return } -func (d *driverGCE) refreshZoneOp(op *compute.Operation) stateRefreshFunc { +func (d *driverGCE) refreshZoneOp(zone string, op *compute.Operation) stateRefreshFunc { return func() (string, error) { - newOp, err := d.service.ZoneOperations.Get(d.projectId, op.Zone, op.Name).Do() + newOp, err := d.service.ZoneOperations.Get(d.projectId, zone, op.Name).Do() if err != nil { return "", err } diff --git a/builder/googlecompute/private_key.go b/builder/googlecompute/private_key.go index 476d71a9e..6bf22a309 100644 --- a/builder/googlecompute/private_key.go +++ b/builder/googlecompute/private_key.go @@ -18,7 +18,8 @@ func processPrivateKeyFile(privateKeyFile, passphrase string) ([]byte, error) { PEMBlock, _ := pem.Decode(rawPrivateKeyBytes) if PEMBlock == nil { - return nil, fmt.Errorf("%s does not contain a vaild private key", privateKeyFile) + return nil, fmt.Errorf( + "%s does not contain a vaild private key", privateKeyFile) } if x509.IsEncryptedPEMBlock(PEMBlock) { diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 2bfacd287..eb6f3f0bf 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -39,6 +39,7 @@ func (s *StepCreateInstance) Run(state multistep.StateBag) multistep.StepAction }) if err == nil { + ui.Message("Waiting for creation operation to complete...") select { case err = <-errCh: case <-time.After(config.stateTimeout):