diff --git a/builder/ncloud/builder.go b/builder/ncloud/builder.go index e493661be..18f45b53c 100644 --- a/builder/ncloud/builder.go +++ b/builder/ncloud/builder.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // Builder assume this implements packer.Builder diff --git a/builder/ncloud/ssh.go b/builder/ncloud/ssh.go index 5e7d31748..08764aee6 100644 --- a/builder/ncloud/ssh.go +++ b/builder/ncloud/ssh.go @@ -2,7 +2,7 @@ package ncloud import ( packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/ncloud/step.go b/builder/ncloud/step.go index ba71efbee..8b312fae7 100644 --- a/builder/ncloud/step.go +++ b/builder/ncloud/step.go @@ -1,7 +1,7 @@ package ncloud import ( - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func processStepResult(err error, sayError func(error), state multistep.StateBag) multistep.StepAction { diff --git a/builder/ncloud/step_create_block_storage_instance.go b/builder/ncloud/step_create_block_storage_instance.go index 7e4d4b54a..b135a15e7 100644 --- a/builder/ncloud/step_create_block_storage_instance.go +++ b/builder/ncloud/step_create_block_storage_instance.go @@ -1,14 +1,15 @@ package ncloud import ( + "context" "errors" "fmt" "log" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateBlockStorageInstance struct is for making extra block storage @@ -54,7 +55,7 @@ func (s *StepCreateBlockStorageInstance) createBlockStorageInstance(serverInstan return blockStorageInstanceList.BlockStorageInstance[0].BlockStorageInstanceNo, nil } -func (s *StepCreateBlockStorageInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateBlockStorageInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if s.Config.BlockStorageSize == 0 { return processStepResult(nil, s.Error, state) } diff --git a/builder/ncloud/step_create_block_storage_instance_test.go b/builder/ncloud/step_create_block_storage_instance_test.go index 101e94658..feae195d1 100644 --- a/builder/ncloud/step_create_block_storage_instance_test.go +++ b/builder/ncloud/step_create_block_storage_instance_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateBlockStorageInstanceShouldFailIfOperationCreateBlockStorageInstanceFails(t *testing.T) { diff --git a/builder/ncloud/step_create_login_key.go b/builder/ncloud/step_create_login_key.go index f79c4decf..05ef97739 100644 --- a/builder/ncloud/step_create_login_key.go +++ b/builder/ncloud/step_create_login_key.go @@ -1,12 +1,13 @@ package ncloud import ( + "context" "fmt" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type LoginKey struct { @@ -44,7 +45,7 @@ func (s *StepCreateLoginKey) createLoginKey() (*LoginKey, error) { return &LoginKey{KeyName, privateKey.PrivateKey}, nil } -func (s *StepCreateLoginKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateLoginKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Login Key") loginKey, err := s.CreateLoginKey() diff --git a/builder/ncloud/step_create_login_key_test.go b/builder/ncloud/step_create_login_key_test.go index 374d10330..6f0d7af8f 100644 --- a/builder/ncloud/step_create_login_key_test.go +++ b/builder/ncloud/step_create_login_key_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateLoginKeyShouldFailIfOperationCreateLoginKeyFails(t *testing.T) { diff --git a/builder/ncloud/step_create_public_ip_instance.go b/builder/ncloud/step_create_public_ip_instance.go index e9c4a8e37..d4cd72b6d 100644 --- a/builder/ncloud/step_create_public_ip_instance.go +++ b/builder/ncloud/step_create_public_ip_instance.go @@ -1,13 +1,14 @@ package ncloud import ( + "context" "fmt" "log" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreatePublicIPInstance struct { @@ -84,7 +85,7 @@ func (s *StepCreatePublicIPInstance) createPublicIPInstance(serverInstanceNo str return &publicIPInstance, nil } -func (s *StepCreatePublicIPInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreatePublicIPInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Public IP Instance") serverInstanceNo := state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_create_public_ip_instance_test.go b/builder/ncloud/step_create_public_ip_instance_test.go index 0f44f4a33..7269e3af5 100644 --- a/builder/ncloud/step_create_public_ip_instance_test.go +++ b/builder/ncloud/step_create_public_ip_instance_test.go @@ -2,10 +2,11 @@ package ncloud import ( "fmt" - ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" "testing" - "github.com/mitchellh/multistep" + ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreatePublicIPInstanceShouldFailIfOperationCreatePublicIPInstanceFails(t *testing.T) { diff --git a/builder/ncloud/step_create_server_image.go b/builder/ncloud/step_create_server_image.go index 8bec7f11f..447485641 100644 --- a/builder/ncloud/step_create_server_image.go +++ b/builder/ncloud/step_create_server_image.go @@ -1,13 +1,14 @@ package ncloud import ( + "context" "errors" "fmt" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateServerImage struct { @@ -60,7 +61,7 @@ func (s *StepCreateServerImage) createServerImage(serverInstanceNo string) (*ncl return &serverImage, nil } -func (s *StepCreateServerImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateServerImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Server Image") serverInstanceNo := state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_create_server_image_test.go b/builder/ncloud/step_create_server_image_test.go index 41a40971a..fa7745135 100644 --- a/builder/ncloud/step_create_server_image_test.go +++ b/builder/ncloud/step_create_server_image_test.go @@ -2,10 +2,11 @@ package ncloud import ( "fmt" - ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" "testing" - "github.com/mitchellh/multistep" + ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateServerImageShouldFailIfOperationCreateServerImageFails(t *testing.T) { diff --git a/builder/ncloud/step_create_server_instance.go b/builder/ncloud/step_create_server_instance.go index 346ce3a1c..a8a72586d 100644 --- a/builder/ncloud/step_create_server_instance.go +++ b/builder/ncloud/step_create_server_instance.go @@ -1,6 +1,7 @@ package ncloud import ( + "context" "errors" "fmt" "io/ioutil" @@ -8,8 +9,8 @@ import ( "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateServerInstance struct { @@ -81,7 +82,7 @@ func (s *StepCreateServerInstance) createServerInstance(loginKeyName string, zon return s.serverInstanceNo, nil } -func (s *StepCreateServerInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Server Instance") var loginKey = state.Get("LoginKey").(*LoginKey) diff --git a/builder/ncloud/step_create_server_instance_test.go b/builder/ncloud/step_create_server_instance_test.go index ddaa34157..db337c41b 100644 --- a/builder/ncloud/step_create_server_instance_test.go +++ b/builder/ncloud/step_create_server_instance_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateServerInstanceShouldFailIfOperationCreateFails(t *testing.T) { diff --git a/builder/ncloud/step_delete_block_storage_instance.go b/builder/ncloud/step_delete_block_storage_instance.go index 61f8b7c3c..d43edf1c9 100644 --- a/builder/ncloud/step_delete_block_storage_instance.go +++ b/builder/ncloud/step_delete_block_storage_instance.go @@ -1,14 +1,15 @@ package ncloud import ( + "context" "errors" "fmt" "log" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepDeleteBlockStorageInstance struct { @@ -77,7 +78,7 @@ func (s *StepDeleteBlockStorageInstance) deleteBlockStorageInstance(serverInstan return nil } -func (s *StepDeleteBlockStorageInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteBlockStorageInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if s.Config.BlockStorageSize == 0 { return processStepResult(nil, s.Error, state) } diff --git a/builder/ncloud/step_delete_block_storage_instance_test.go b/builder/ncloud/step_delete_block_storage_instance_test.go index ce0f0cb09..c5fc4566e 100644 --- a/builder/ncloud/step_delete_block_storage_instance_test.go +++ b/builder/ncloud/step_delete_block_storage_instance_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDeleteBlockStorageInstanceShouldFailIfOperationDeleteBlockStorageInstanceFails(t *testing.T) { diff --git a/builder/ncloud/step_get_rootpassword.go b/builder/ncloud/step_get_rootpassword.go index d9eda578a..051eb386b 100644 --- a/builder/ncloud/step_get_rootpassword.go +++ b/builder/ncloud/step_get_rootpassword.go @@ -1,11 +1,12 @@ package ncloud import ( + "context" "fmt" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepGetRootPassword struct { @@ -42,7 +43,7 @@ func (s *StepGetRootPassword) getRootPassword(serverInstanceNo string, privateKe return rootPassword.RootPassword, nil } -func (s *StepGetRootPassword) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetRootPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Get Root Password") serverInstanceNo := state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_get_rootpassword_test.go b/builder/ncloud/step_get_rootpassword_test.go index b9ed6aa56..1717b5753 100644 --- a/builder/ncloud/step_get_rootpassword_test.go +++ b/builder/ncloud/step_get_rootpassword_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepGetRootPasswordShouldFailIfOperationGetRootPasswordFails(t *testing.T) { diff --git a/builder/ncloud/step_stop_server_instance.go b/builder/ncloud/step_stop_server_instance.go index f9cce7d9f..293c8e55d 100644 --- a/builder/ncloud/step_stop_server_instance.go +++ b/builder/ncloud/step_stop_server_instance.go @@ -1,13 +1,14 @@ package ncloud import ( + "context" "fmt" "log" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepStopServerInstance struct { @@ -50,7 +51,7 @@ func (s *StepStopServerInstance) stopServerInstance(serverInstanceNo string) err return nil } -func (s *StepStopServerInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepStopServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Stop Server Instance") var serverInstanceNo = state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_stop_server_instance_test.go b/builder/ncloud/step_stop_server_instance_test.go index d90bc6953..04c39d313 100644 --- a/builder/ncloud/step_stop_server_instance_test.go +++ b/builder/ncloud/step_stop_server_instance_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepStopServerInstanceShouldFailIfOperationStopFails(t *testing.T) { diff --git a/builder/ncloud/step_terminate_server_instance.go b/builder/ncloud/step_terminate_server_instance.go index aa154812b..f6c8d281a 100644 --- a/builder/ncloud/step_terminate_server_instance.go +++ b/builder/ncloud/step_terminate_server_instance.go @@ -1,12 +1,13 @@ package ncloud import ( + "context" "errors" "time" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepTerminateServerInstance struct { @@ -66,7 +67,7 @@ func (s *StepTerminateServerInstance) terminateServerInstance(serverInstanceNo s } } -func (s *StepTerminateServerInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTerminateServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Terminate Server Instance") var serverInstanceNo = state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_terminate_server_instance_test.go b/builder/ncloud/step_terminate_server_instance_test.go index b5967fc65..9256b85b9 100644 --- a/builder/ncloud/step_terminate_server_instance_test.go +++ b/builder/ncloud/step_terminate_server_instance_test.go @@ -2,8 +2,9 @@ package ncloud import ( "fmt" - "github.com/mitchellh/multistep" "testing" + + "github.com/hashicorp/packer/helper/multistep" ) func TestStepTerminateServerInstanceShouldFailIfOperationTerminationFails(t *testing.T) { diff --git a/builder/ncloud/step_validate_template.go b/builder/ncloud/step_validate_template.go index d4c576946..c63c5f04b 100644 --- a/builder/ncloud/step_validate_template.go +++ b/builder/ncloud/step_validate_template.go @@ -2,13 +2,14 @@ package ncloud import ( "bytes" + "context" "errors" "fmt" "strings" ncloud "github.com/NaverCloudPlatform/ncloud-sdk-go/sdk" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/olekukonko/tablewriter" ) @@ -249,7 +250,7 @@ func (s *StepValidateTemplate) validateTemplate() error { } // Run : main funciton for validation a template -func (s *StepValidateTemplate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepValidateTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Validating deployment template ...") err := s.Validate() diff --git a/builder/ncloud/step_validate_template_test.go b/builder/ncloud/step_validate_template_test.go index 98f45b4a0..6836f8446 100644 --- a/builder/ncloud/step_validate_template_test.go +++ b/builder/ncloud/step_validate_template_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepValidateTemplateShouldFailIfValidateFails(t *testing.T) {