From f9c7606452b0f7058354757421b3dec2485291c1 Mon Sep 17 00:00:00 2001 From: Gennady Lipenkov Date: Fri, 12 Apr 2019 01:10:52 +0300 Subject: [PATCH] Adopt new Builder interface signature --- builder/yandex/builder.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/builder/yandex/builder.go b/builder/yandex/builder.go index b462c1578..38ea7524d 100644 --- a/builder/yandex/builder.go +++ b/builder/yandex/builder.go @@ -1,8 +1,8 @@ package yandex import ( + "context" "fmt" - "log" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" @@ -33,7 +33,7 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { // Run executes a yandex Packer build and returns a packer.Artifact // representing a Yandex.Cloud compute image. -func (b *Builder) Run(ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { +func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { driver, err := NewDriverYC(ui, b.config) if err != nil { @@ -74,7 +74,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { // Run the steps b.runner = common.NewRunner(steps, b.config.PackerConfig, ui) - b.runner.Run(state) + b.runner.Run(ctx, state) // Report any errors if rawErr, ok := state.GetOk("error"); ok { @@ -92,11 +92,3 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { } return artifact, nil } - -// Cancel. -func (b *Builder) Cancel() { - if b.runner != nil { - log.Println("Cancelling the step runner...") - b.runner.Cancel() - } -}