From e752e3a01847351130f3854d77a3d00ccd5dca4b Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 5 Feb 2018 16:50:32 -0800 Subject: [PATCH] use new internal multistep helper --- builder/scaleway/builder.go | 2 +- builder/scaleway/ssh.go | 2 +- builder/scaleway/step_create_image.go | 5 +++-- builder/scaleway/step_create_server.go | 5 +++-- builder/scaleway/step_create_ssh_key.go | 5 +++-- builder/scaleway/step_server_info.go | 5 +++-- builder/scaleway/step_shutdown.go | 5 +++-- builder/scaleway/step_snapshot.go | 5 +++-- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/builder/scaleway/builder.go b/builder/scaleway/builder.go index 8c5d79fde..457002c74 100644 --- a/builder/scaleway/builder.go +++ b/builder/scaleway/builder.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) diff --git a/builder/scaleway/ssh.go b/builder/scaleway/ssh.go index 2e566936e..a2c9b8f16 100644 --- a/builder/scaleway/ssh.go +++ b/builder/scaleway/ssh.go @@ -6,7 +6,7 @@ import ( "os" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/scaleway/step_create_image.go b/builder/scaleway/step_create_image.go index 313f2e421..16345e74d 100644 --- a/builder/scaleway/step_create_image.go +++ b/builder/scaleway/step_create_image.go @@ -1,17 +1,18 @@ package scaleway import ( + "context" "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) type stepImage struct{} -func (s *stepImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*api.ScalewayAPI) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config) diff --git a/builder/scaleway/step_create_server.go b/builder/scaleway/step_create_server.go index ddd06fdf5..57511d149 100644 --- a/builder/scaleway/step_create_server.go +++ b/builder/scaleway/step_create_server.go @@ -1,11 +1,12 @@ package scaleway import ( + "context" "fmt" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) @@ -13,7 +14,7 @@ type stepCreateServer struct { serverID string } -func (s *stepCreateServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*api.ScalewayAPI) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config) diff --git a/builder/scaleway/step_create_ssh_key.go b/builder/scaleway/step_create_ssh_key.go index dab8f710b..c5405ccd6 100644 --- a/builder/scaleway/step_create_ssh_key.go +++ b/builder/scaleway/step_create_ssh_key.go @@ -1,6 +1,7 @@ package scaleway import ( + "context" "crypto/rand" "crypto/rsa" "crypto/x509" @@ -12,8 +13,8 @@ import ( "runtime" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) @@ -23,7 +24,7 @@ type stepCreateSSHKey struct { PrivateKeyFile string } -func (s *stepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/scaleway/step_server_info.go b/builder/scaleway/step_server_info.go index 38502fe4d..7ab14658f 100644 --- a/builder/scaleway/step_server_info.go +++ b/builder/scaleway/step_server_info.go @@ -1,16 +1,17 @@ package scaleway import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) type stepServerInfo struct{} -func (s *stepServerInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepServerInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*api.ScalewayAPI) ui := state.Get("ui").(packer.Ui) serverID := state.Get("server_id").(string) diff --git a/builder/scaleway/step_shutdown.go b/builder/scaleway/step_shutdown.go index b8e45be51..a8a029259 100644 --- a/builder/scaleway/step_shutdown.go +++ b/builder/scaleway/step_shutdown.go @@ -1,16 +1,17 @@ package scaleway import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) type stepShutdown struct{} -func (s *stepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*api.ScalewayAPI) ui := state.Get("ui").(packer.Ui) serverID := state.Get("server_id").(string) diff --git a/builder/scaleway/step_snapshot.go b/builder/scaleway/step_snapshot.go index 20301a444..fd0dcb593 100644 --- a/builder/scaleway/step_snapshot.go +++ b/builder/scaleway/step_snapshot.go @@ -1,17 +1,18 @@ package scaleway import ( + "context" "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/scaleway/scaleway-cli/pkg/api" ) type stepSnapshot struct{} -func (s *stepSnapshot) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*api.ScalewayAPI) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config)