From c4f3dccc148bed4241a3b19f3f1b89824bf39a50 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Fri, 29 Mar 2019 16:50:02 +0100 Subject: [PATCH] rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts --- builder/alicloud/ecs/step_attach_keypair.go | 2 +- builder/alicloud/ecs/step_check_source_image.go | 2 +- builder/alicloud/ecs/step_config_eip.go | 2 +- builder/alicloud/ecs/step_config_key_pair.go | 2 +- builder/alicloud/ecs/step_config_public_ip.go | 2 +- builder/alicloud/ecs/step_config_security_group.go | 2 +- builder/alicloud/ecs/step_config_vpc.go | 2 +- builder/alicloud/ecs/step_config_vswitch.go | 2 +- builder/alicloud/ecs/step_create_image.go | 2 +- builder/alicloud/ecs/step_create_instance.go | 2 +- builder/alicloud/ecs/step_create_snapshot.go | 2 +- builder/alicloud/ecs/step_create_tags.go | 2 +- builder/alicloud/ecs/step_delete_images_snapshots.go | 2 +- builder/alicloud/ecs/step_mount_disk.go | 2 +- builder/alicloud/ecs/step_pre_validate.go | 2 +- builder/alicloud/ecs/step_region_copy_image.go | 2 +- builder/alicloud/ecs/step_run_instance.go | 2 +- builder/alicloud/ecs/step_share_image.go | 2 +- builder/alicloud/ecs/step_stop_instance.go | 2 +- builder/amazon/chroot/builder.go | 6 +++--- builder/amazon/chroot/run_local_commands.go | 4 ++-- builder/amazon/chroot/step_check_root_device.go | 2 +- builder/amazon/chroot/step_copy_files.go | 2 +- builder/amazon/chroot/step_early_cleanup.go | 2 +- builder/amazon/chroot/step_early_unflock.go | 2 +- builder/amazon/chroot/step_flock.go | 2 +- builder/amazon/chroot/step_instance_info.go | 2 +- builder/amazon/chroot/step_mount_device.go | 8 ++++---- builder/amazon/chroot/step_mount_extra.go | 2 +- builder/amazon/chroot/step_post_mount_commands.go | 8 ++++---- builder/amazon/chroot/step_pre_mount_commands.go | 8 ++++---- builder/amazon/chroot/step_prepare_device.go | 2 +- builder/amazon/common/step_cleanup_volumes.go | 2 +- builder/amazon/common/step_create_tags.go | 2 +- builder/amazon/common/step_deregister_ami.go | 2 +- builder/amazon/common/step_get_password.go | 2 +- builder/amazon/common/step_key_pair.go | 2 +- builder/amazon/common/step_modify_ami_attributes.go | 2 +- builder/amazon/common/step_modify_ebs_instance.go | 2 +- builder/amazon/common/step_network_info.go | 2 +- builder/amazon/common/step_pre_validate.go | 2 +- builder/amazon/common/step_security_group.go | 2 +- builder/amazon/common/step_source_ami_info.go | 2 +- builder/amazon/common/tags.go | 8 ++++---- builder/amazon/ebsvolume/step_tag_ebs_volumes.go | 2 +- builder/amazon/instance/step_bundle_volume.go | 2 +- builder/amazon/instance/step_upload_bundle.go | 2 +- builder/amazon/instance/step_upload_x509_cert.go | 2 +- builder/azure/arm/step_capture_image_test.go | 2 +- builder/azure/arm/step_create_resource_group_test.go | 2 +- builder/azure/arm/step_deploy_template_test.go | 2 +- builder/azure/arm/step_get_certificate.go | 2 +- builder/azure/arm/step_save_winrm_password.go | 2 +- builder/azure/arm/step_set_certificate.go | 2 +- builder/cloudstack/step_configure_networking.go | 2 +- builder/cloudstack/step_create_instance.go | 2 +- builder/cloudstack/step_create_security_group.go | 2 +- builder/cloudstack/step_create_template.go | 2 +- builder/cloudstack/step_keypair.go | 2 +- builder/cloudstack/step_prepare_config.go | 2 +- builder/cloudstack/step_shutdown_instance.go | 2 +- builder/digitalocean/step_create_droplet.go | 2 +- builder/digitalocean/step_create_ssh_key.go | 2 +- builder/digitalocean/step_droplet_info.go | 2 +- builder/digitalocean/step_power_off.go | 2 +- builder/digitalocean/step_shutdown.go | 2 +- builder/digitalocean/step_snapshot.go | 2 +- builder/docker/driver_docker.go | 6 +++--- builder/docker/step_commit.go | 2 +- builder/docker/step_connect_docker.go | 2 +- builder/docker/step_export.go | 2 +- builder/docker/step_pull.go | 2 +- builder/docker/step_run.go | 2 +- builder/docker/step_temp_dir.go | 2 +- builder/googlecompute/step_check_existing_image.go | 2 +- builder/googlecompute/step_create_image.go | 2 +- builder/googlecompute/step_create_instance.go | 2 +- builder/googlecompute/step_create_ssh_key.go | 2 +- .../googlecompute/step_create_windows_password.go | 2 +- builder/googlecompute/step_instance_info.go | 2 +- builder/googlecompute/step_teardown_instance.go | 2 +- builder/googlecompute/step_wait_startup_script.go | 2 +- builder/hyperone/builder.go | 6 +++--- builder/hyperone/step_copy_files.go | 2 +- builder/hyperone/step_create_ssh_key.go | 2 +- builder/hyperone/step_mount_extra.go | 2 +- builder/hyperone/step_post_mount_commands.go | 8 ++++---- builder/hyperone/step_pre_mount_commands.go | 8 ++++---- builder/hyperone/step_prepare_device.go | 2 +- builder/hyperone/utils.go | 4 ++-- builder/hyperv/common/step_clone_vm.go | 2 +- builder/hyperv/common/step_collate_artifacts.go | 2 +- builder/hyperv/common/step_compact_disk.go | 2 +- builder/hyperv/common/step_configure_ip.go | 2 +- builder/hyperv/common/step_configure_vlan.go | 2 +- builder/hyperv/common/step_create_build_dir.go | 2 +- builder/hyperv/common/step_create_external_switch.go | 2 +- builder/hyperv/common/step_create_switch.go | 2 +- builder/hyperv/common/step_create_vm.go | 2 +- builder/hyperv/common/step_disable_vlan.go | 2 +- .../hyperv/common/step_enable_integration_service.go | 2 +- builder/hyperv/common/step_export_vm.go | 2 +- builder/hyperv/common/step_mount_dvddrive.go | 2 +- builder/hyperv/common/step_mount_floppydrive.go | 2 +- builder/hyperv/common/step_mount_guest_additions.go | 2 +- .../hyperv/common/step_mount_secondary_dvd_images.go | 2 +- builder/hyperv/common/step_polling_installation.go | 2 +- builder/hyperv/common/step_reboot_vm.go | 2 +- builder/hyperv/common/step_run.go | 2 +- builder/hyperv/common/step_shutdown.go | 2 +- builder/hyperv/common/step_sleep.go | 2 +- builder/hyperv/common/step_unmount_dvddrive.go | 2 +- builder/hyperv/common/step_unmount_floppydrive.go | 2 +- .../hyperv/common/step_unmount_guest_additions.go | 2 +- .../common/step_unmount_secondary_dvd_images.go | 2 +- .../common/step_wait_for_install_to_complete.go | 4 ++-- builder/lxc/step_export.go | 2 +- builder/lxc/step_lxc_create.go | 2 +- builder/lxc/step_prepare_output_dir.go | 2 +- builder/lxc/step_wait_init.go | 2 +- builder/lxd/step_lxd_launch.go | 2 +- builder/lxd/step_publish.go | 2 +- builder/ncloud/step_create_block_storage_instance.go | 2 +- builder/ncloud/step_create_login_key.go | 2 +- builder/ncloud/step_create_public_ip_instance.go | 2 +- builder/ncloud/step_create_server_image.go | 2 +- builder/ncloud/step_create_server_instance.go | 2 +- builder/ncloud/step_delete_block_storage_instance.go | 2 +- builder/ncloud/step_get_rootpassword.go | 2 +- builder/ncloud/step_stop_server_instance.go | 2 +- builder/ncloud/step_terminate_server_instance.go | 2 +- builder/ncloud/step_validate_template.go | 2 +- builder/oneandone/step_create_server.go | 2 +- builder/oneandone/step_create_sshkey.go | 2 +- builder/oneandone/step_take_snapshot.go | 2 +- builder/openstack/step_add_image_members.go | 2 +- builder/openstack/step_allocate_ip.go | 2 +- builder/openstack/step_create_volume.go | 2 +- builder/openstack/step_detach_volume.go | 2 +- builder/openstack/step_get_password.go | 2 +- builder/openstack/step_key_pair.go | 2 +- builder/openstack/step_load_flavor.go | 2 +- builder/openstack/step_run_source_server.go | 2 +- builder/openstack/step_source_image_info.go | 2 +- builder/openstack/step_stop_server.go | 2 +- builder/openstack/step_update_image_tags.go | 2 +- builder/openstack/step_update_image_visibility.go | 2 +- builder/openstack/step_wait_for_rackconnect.go | 2 +- builder/oracle/classic/step_add_keys.go | 2 +- builder/oracle/classic/step_attach_volume.go | 2 +- builder/oracle/classic/step_create_image.go | 2 +- builder/oracle/classic/step_create_instance.go | 2 +- builder/oracle/classic/step_create_ip_reservation.go | 2 +- .../oracle/classic/step_create_persistent_volume.go | 2 +- builder/oracle/classic/step_create_pv_builder.go | 2 +- builder/oracle/classic/step_create_pv_master.go | 2 +- builder/oracle/classic/step_list_images.go | 2 +- builder/oracle/classic/step_security.go | 2 +- builder/oracle/classic/step_snapshot.go | 2 +- builder/oracle/classic/step_terminate_pv_master.go | 2 +- builder/oracle/classic/step_upload_image.go | 2 +- builder/oracle/common/step_ssh_key_pair.go | 2 +- builder/parallels/common/step_attach_floppy.go | 2 +- .../parallels/common/step_attach_parallels_tools.go | 2 +- builder/parallels/common/step_compact_disk.go | 2 +- builder/parallels/common/step_output_dir.go | 2 +- .../parallels/common/step_prepare_parallels_tools.go | 2 +- builder/parallels/common/step_prlctl.go | 2 +- builder/parallels/common/step_run.go | 2 +- builder/parallels/common/step_shutdown.go | 2 +- .../parallels/common/step_upload_parallels_tools.go | 2 +- builder/parallels/common/step_upload_version.go | 2 +- builder/parallels/iso/step_attach_iso.go | 2 +- builder/parallels/iso/step_create_disk.go | 2 +- builder/parallels/iso/step_create_vm.go | 2 +- builder/parallels/iso/step_set_boot_order.go | 2 +- builder/parallels/pvm/step_import.go | 2 +- builder/profitbricks/step_create_server.go | 2 +- builder/profitbricks/step_create_ssh_key.go | 2 +- builder/profitbricks/step_take_snapshot.go | 2 +- builder/qemu/step_convert_disk.go | 2 +- builder/qemu/step_copy_disk.go | 2 +- builder/qemu/step_create_disk.go | 2 +- builder/qemu/step_prepare_output_dir.go | 2 +- builder/qemu/step_resize_disk.go | 2 +- builder/qemu/step_run.go | 10 +++++----- builder/qemu/step_set_iso.go | 2 +- builder/qemu/step_shutdown.go | 2 +- builder/scaleway/step_create_image.go | 2 +- builder/scaleway/step_create_server.go | 2 +- builder/scaleway/step_create_ssh_key.go | 2 +- builder/scaleway/step_server_info.go | 2 +- builder/scaleway/step_shutdown.go | 2 +- builder/scaleway/step_snapshot.go | 2 +- builder/tencentcloud/cvm/step_check_source_image.go | 2 +- builder/tencentcloud/cvm/step_config_key_pair.go | 2 +- .../tencentcloud/cvm/step_config_security_group.go | 2 +- builder/tencentcloud/cvm/step_config_subnet.go | 2 +- builder/tencentcloud/cvm/step_config_vpc.go | 2 +- builder/tencentcloud/cvm/step_copy_image.go | 2 +- builder/tencentcloud/cvm/step_create_image.go | 2 +- builder/tencentcloud/cvm/step_pre_validate.go | 2 +- builder/tencentcloud/cvm/step_run_instance.go | 2 +- builder/tencentcloud/cvm/step_share_image.go | 2 +- builder/triton/step_create_image_from_machine.go | 2 +- builder/triton/step_create_source_machine.go | 2 +- builder/triton/step_delete_machine.go | 2 +- builder/triton/step_stop_machine.go | 2 +- builder/triton/step_wait_for_stop_to_not_fail.go | 2 +- builder/vagrant/step_add_box.go | 2 +- builder/vagrant/step_create_vagrantfile.go | 2 +- builder/vagrant/step_package.go | 2 +- builder/vagrant/step_ssh_config.go | 2 +- builder/vagrant/step_up.go | 2 +- builder/virtualbox/common/step_attach_floppy.go | 2 +- .../virtualbox/common/step_attach_guest_additions.go | 2 +- builder/virtualbox/common/step_export.go | 2 +- builder/virtualbox/common/step_remove_devices.go | 2 +- builder/virtualbox/common/step_run.go | 2 +- builder/virtualbox/common/step_shutdown.go | 2 +- builder/virtualbox/common/step_ssh_key_pair.go | 2 +- builder/virtualbox/common/step_suppress_messages.go | 2 +- .../virtualbox/common/step_upload_guest_additions.go | 2 +- builder/virtualbox/common/step_upload_version.go | 2 +- builder/virtualbox/common/step_vboxmanage.go | 2 +- builder/virtualbox/iso/step_attach_iso.go | 2 +- builder/virtualbox/iso/step_create_disk.go | 2 +- builder/virtualbox/iso/step_create_vm.go | 2 +- builder/virtualbox/ovf/step_import.go | 2 +- builder/vmware/common/step_clean_files.go | 2 +- builder/vmware/common/step_clean_vmx.go | 2 +- builder/vmware/common/step_compact_disk.go | 2 +- builder/vmware/common/step_configure_vmx.go | 2 +- builder/vmware/common/step_export.go | 2 +- builder/vmware/common/step_output_dir.go | 2 +- builder/vmware/common/step_prepare_tools.go | 2 +- builder/vmware/common/step_register.go | 2 +- builder/vmware/common/step_run.go | 2 +- builder/vmware/common/step_shutdown.go | 2 +- builder/vmware/common/step_suppress_messages.go | 2 +- builder/vmware/common/step_upload_tools.go | 2 +- builder/vmware/common/step_upload_vmx.go | 2 +- builder/vmware/iso/step_create_disk.go | 2 +- builder/vmware/iso/step_create_vmx.go | 12 ++++++------ builder/vmware/iso/step_remote_upload.go | 2 +- builder/vmware/vmx/step_clone_vmx.go | 2 +- common/step_cleanup_temp_keys.go | 2 +- common/step_create_floppy.go | 2 +- common/step_output_dir.go | 2 +- helper/communicator/step_connect_ssh.go | 2 +- helper/communicator/step_connect_winrm.go | 2 +- helper/multistep/debug_runner.go | 2 +- helper/multistep/multistep_test.go | 4 ++-- post-processor/vagrant-cloud/step_create_provider.go | 2 +- post-processor/vagrant-cloud/step_create_version.go | 2 +- post-processor/vagrant-cloud/step_prepare_upload.go | 2 +- post-processor/vagrant-cloud/step_release_version.go | 2 +- post-processor/vagrant-cloud/step_upload.go | 2 +- post-processor/vagrant-cloud/step_verify_box.go | 2 +- .../vsphere-template/step_choose_datacenter.go | 2 +- .../vsphere-template/step_create_folder.go | 2 +- .../vsphere-template/step_create_snapshot.go | 2 +- .../vsphere-template/step_mark_as_template.go | 2 +- provisioner/chef-client/provisioner.go | 12 ++++++------ template/interpolate/i.go | 8 ++++---- 265 files changed, 310 insertions(+), 310 deletions(-) diff --git a/builder/alicloud/ecs/step_attach_keypair.go b/builder/alicloud/ecs/step_attach_keypair.go index 08c52d0d8..fb6c26bfb 100644 --- a/builder/alicloud/ecs/step_attach_keypair.go +++ b/builder/alicloud/ecs/step_attach_keypair.go @@ -15,7 +15,7 @@ import ( type stepAttachKeyPair struct { } -func (s *stepAttachKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAttachKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) client := state.Get("client").(*ecs.Client) config := state.Get("config").(*Config) diff --git a/builder/alicloud/ecs/step_check_source_image.go b/builder/alicloud/ecs/step_check_source_image.go index ebd4e56cb..0f7f31314 100644 --- a/builder/alicloud/ecs/step_check_source_image.go +++ b/builder/alicloud/ecs/step_check_source_image.go @@ -14,7 +14,7 @@ type stepCheckAlicloudSourceImage struct { SourceECSImageId string } -func (s *stepCheckAlicloudSourceImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCheckAlicloudSourceImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index 922161c28..669beec93 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -19,7 +19,7 @@ type stepConfigAlicloudEIP struct { SSHPrivateIp bool } -func (s *stepConfigAlicloudEIP) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudEIP) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index c4307378e..d1085306a 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -22,7 +22,7 @@ type stepConfigAlicloudKeyPair struct { keyName string } -func (s *stepConfigAlicloudKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index 3dc21a620..ac005f1a2 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -15,7 +15,7 @@ type stepConfigAlicloudPublicIP struct { SSHPrivateIp bool } -func (s *stepConfigAlicloudPublicIP) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudPublicIP) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index 951f6e6fe..3d70558bd 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -21,7 +21,7 @@ type stepConfigAlicloudSecurityGroup struct { isCreate bool } -func (s *stepConfigAlicloudSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) networkType := state.Get("networktype").(InstanceNetWork) diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index c86746d1f..5bcd703a6 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -19,7 +19,7 @@ type stepConfigAlicloudVPC struct { isCreate bool } -func (s *stepConfigAlicloudVPC) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudVPC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index 4daa81a69..8025c30ec 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -20,7 +20,7 @@ type stepConfigAlicloudVSwitch struct { VSwitchName string } -func (s *stepConfigAlicloudVSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudVSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) vpcId := state.Get("vpcid").(string) diff --git a/builder/alicloud/ecs/step_create_image.go b/builder/alicloud/ecs/step_create_image.go index e9fb009b1..9be398958 100644 --- a/builder/alicloud/ecs/step_create_image.go +++ b/builder/alicloud/ecs/step_create_image.go @@ -16,7 +16,7 @@ type stepCreateAlicloudImage struct { image *ecs.ImageType } -func (s *stepCreateAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAlicloudImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index d35483562..98b3276e4 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -26,7 +26,7 @@ type stepCreateAlicloudInstance struct { instance *ecs.InstanceAttributesType } -func (s *stepCreateAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_create_snapshot.go b/builder/alicloud/ecs/step_create_snapshot.go index e1b0386c8..bf61d641a 100644 --- a/builder/alicloud/ecs/step_create_snapshot.go +++ b/builder/alicloud/ecs/step_create_snapshot.go @@ -15,7 +15,7 @@ type stepCreateAlicloudSnapshot struct { WaitSnapshotReadyTimeout int } -func (s *stepCreateAlicloudSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAlicloudSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_create_tags.go b/builder/alicloud/ecs/step_create_tags.go index 5988dd3b4..7778a53db 100644 --- a/builder/alicloud/ecs/step_create_tags.go +++ b/builder/alicloud/ecs/step_create_tags.go @@ -14,7 +14,7 @@ type stepCreateTags struct { Tags map[string]string } -func (s *stepCreateTags) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateTags) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index 68b9cee12..7ca6b3460 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -19,7 +19,7 @@ type stepDeleteAlicloudImageSnapshots struct { AlicloudImageDestinationNames []string } -func (s *stepDeleteAlicloudImageSnapshots) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepDeleteAlicloudImageSnapshots) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) // Check for force delete diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go index 40b3dc792..1f330ee9f 100644 --- a/builder/alicloud/ecs/step_mount_disk.go +++ b/builder/alicloud/ecs/step_mount_disk.go @@ -12,7 +12,7 @@ import ( type stepMountAlicloudDisk struct { } -func (s *stepMountAlicloudDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepMountAlicloudDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index 698ed35e5..09b5b4c54 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -15,7 +15,7 @@ type stepPreValidate struct { ForceDelete bool } -func (s *stepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPreValidate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.ForceDelete { ui.Say("Force delete flag found, skipping prevalidating image name.") diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index c0de5eeb9..9349d0364 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -16,7 +16,7 @@ type stepRegionCopyAlicloudImage struct { RegionId string } -func (s *stepRegionCopyAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepRegionCopyAlicloudImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.AlicloudImageDestinationRegions) == 0 { return multistep.ActionContinue } diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index 06e21df7f..627df3ed6 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -12,7 +12,7 @@ import ( type stepRunAlicloudInstance struct { } -func (s *stepRunAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepRunAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_share_image.go b/builder/alicloud/ecs/step_share_image.go index 6e9ae6ed0..178cf50d7 100644 --- a/builder/alicloud/ecs/step_share_image.go +++ b/builder/alicloud/ecs/step_share_image.go @@ -16,7 +16,7 @@ type stepShareAlicloudImage struct { RegionId string } -func (s *stepShareAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShareAlicloudImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) alicloudImages := state.Get("alicloudimages").(map[string]string) diff --git a/builder/alicloud/ecs/step_stop_instance.go b/builder/alicloud/ecs/step_stop_instance.go index ee4d79e3a..6a4a2b4f0 100644 --- a/builder/alicloud/ecs/step_stop_instance.go +++ b/builder/alicloud/ecs/step_stop_instance.go @@ -14,7 +14,7 @@ type stepStopAlicloudInstance struct { DisableStop bool } -func (s *stepStopAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepStopAlicloudInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) instance := state.Get("instance").(*ecs.InstanceAttributesType) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 5d2fb4c90..60f127704 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -202,9 +202,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack ec2conn := ec2.New(session) wrappedCommand := func(command string) (string, error) { - ctx := b.config.ctx - ctx.Data = &wrappedCommandTemplate{Command: command} - return interpolate.Render(b.config.CommandWrapper, &ctx) + ictx := b.config.ctx + ictx.Data = &wrappedCommandTemplate{Command: command} + return interpolate.Render(b.config.CommandWrapper, &ictx) } // Setup the state bag and initial state for the steps diff --git a/builder/amazon/chroot/run_local_commands.go b/builder/amazon/chroot/run_local_commands.go index fc1c01e2b..02578f27d 100644 --- a/builder/amazon/chroot/run_local_commands.go +++ b/builder/amazon/chroot/run_local_commands.go @@ -8,9 +8,9 @@ import ( "github.com/hashicorp/packer/template/interpolate" ) -func RunLocalCommands(commands []string, wrappedCommand CommandWrapper, ctx interpolate.Context, ui packer.Ui) error { +func RunLocalCommands(commands []string, wrappedCommand CommandWrapper, ictx interpolate.Context, ui packer.Ui) error { for _, rawCmd := range commands { - intCmd, err := interpolate.Render(rawCmd, &ctx) + intCmd, err := interpolate.Render(rawCmd, &ictx) if err != nil { return fmt.Errorf("Error interpolating: %s", err) } diff --git a/builder/amazon/chroot/step_check_root_device.go b/builder/amazon/chroot/step_check_root_device.go index 5ff66d055..3933680e3 100644 --- a/builder/amazon/chroot/step_check_root_device.go +++ b/builder/amazon/chroot/step_check_root_device.go @@ -12,7 +12,7 @@ import ( // StepCheckRootDevice makes sure the root device on the AMI is EBS-backed. type StepCheckRootDevice struct{} -func (s *StepCheckRootDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCheckRootDevice) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { image := state.Get("source_image").(*ec2.Image) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go index a973a5d81..78625a8d3 100644 --- a/builder/amazon/chroot/step_copy_files.go +++ b/builder/amazon/chroot/step_copy_files.go @@ -20,7 +20,7 @@ type StepCopyFiles struct { files []string } -func (s *StepCopyFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCopyFiles) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_early_cleanup.go b/builder/amazon/chroot/step_early_cleanup.go index 34e7817df..42d7d66c5 100644 --- a/builder/amazon/chroot/step_early_cleanup.go +++ b/builder/amazon/chroot/step_early_cleanup.go @@ -13,7 +13,7 @@ import ( // prepare for snapshotting and creating an AMI. type StepEarlyCleanup struct{} -func (s *StepEarlyCleanup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepEarlyCleanup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cleanupKeys := []string{ "copy_files_cleanup", diff --git a/builder/amazon/chroot/step_early_unflock.go b/builder/amazon/chroot/step_early_unflock.go index 225e91fb9..b16becc61 100644 --- a/builder/amazon/chroot/step_early_unflock.go +++ b/builder/amazon/chroot/step_early_unflock.go @@ -12,7 +12,7 @@ import ( // StepEarlyUnflock unlocks the flock. type StepEarlyUnflock struct{} -func (s *StepEarlyUnflock) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepEarlyUnflock) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { cleanup := state.Get("flock_cleanup").(Cleanup) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_flock.go b/builder/amazon/chroot/step_flock.go index d75adc7f0..f3fd9d29e 100644 --- a/builder/amazon/chroot/step_flock.go +++ b/builder/amazon/chroot/step_flock.go @@ -19,7 +19,7 @@ type StepFlock struct { fh *os.File } -func (s *StepFlock) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepFlock) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) lockfile := "/var/lock/packer-chroot/lock" diff --git a/builder/amazon/chroot/step_instance_info.go b/builder/amazon/chroot/step_instance_info.go index 558e28a8d..01b0d0ac7 100644 --- a/builder/amazon/chroot/step_instance_info.go +++ b/builder/amazon/chroot/step_instance_info.go @@ -15,7 +15,7 @@ import ( // StepInstanceInfo verifies that this builder is running on an EC2 instance. type StepInstanceInfo struct{} -func (s *StepInstanceInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepInstanceInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_mount_device.go b/builder/amazon/chroot/step_mount_device.go index a05a0fdea..dd9a66873 100644 --- a/builder/amazon/chroot/step_mount_device.go +++ b/builder/amazon/chroot/step_mount_device.go @@ -31,7 +31,7 @@ type StepMountDevice struct { mountPath string } -func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountDevice) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) device := state.Get("device").(string) @@ -50,10 +50,10 @@ func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multi log.Printf("Source image virtualization type is: %s", virtualizationType) } - ctx := config.ctx + ictx := config.ctx - ctx.Data = &mountPathData{Device: filepath.Base(device)} - mountPath, err := interpolate.Render(config.MountPath, &ctx) + ictx.Data = &mountPathData{Device: filepath.Base(device)} + mountPath, err := interpolate.Render(config.MountPath, &ictx) if err != nil { err := fmt.Errorf("Error preparing mount directory: %s", err) diff --git a/builder/amazon/chroot/step_mount_extra.go b/builder/amazon/chroot/step_mount_extra.go index ffd8ac027..089bf7e75 100644 --- a/builder/amazon/chroot/step_mount_extra.go +++ b/builder/amazon/chroot/step_mount_extra.go @@ -20,7 +20,7 @@ type StepMountExtra struct { mounts []string } -func (s *StepMountExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountExtra) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_post_mount_commands.go b/builder/amazon/chroot/step_post_mount_commands.go index a00e8e1bf..704af428f 100644 --- a/builder/amazon/chroot/step_post_mount_commands.go +++ b/builder/amazon/chroot/step_post_mount_commands.go @@ -18,7 +18,7 @@ type StepPostMountCommands struct { Commands []string } -func (s *StepPostMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPostMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) device := state.Get("device").(string) mountPath := state.Get("mount_path").(string) @@ -29,14 +29,14 @@ func (s *StepPostMountCommands) Run(_ context.Context, state multistep.StateBag) return multistep.ActionContinue } - ctx := config.ctx - ctx.Data = &postMountCommandsData{ + ictx := config.ctx + ictx.Data = &postMountCommandsData{ Device: device, MountPath: mountPath, } ui.Say("Running post-mount commands...") - if err := RunLocalCommands(s.Commands, wrappedCommand, ctx, ui); err != nil { + if err := RunLocalCommands(s.Commands, wrappedCommand, ictx, ui); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt diff --git a/builder/amazon/chroot/step_pre_mount_commands.go b/builder/amazon/chroot/step_pre_mount_commands.go index ce3c26e02..9a60256fe 100644 --- a/builder/amazon/chroot/step_pre_mount_commands.go +++ b/builder/amazon/chroot/step_pre_mount_commands.go @@ -16,7 +16,7 @@ type StepPreMountCommands struct { Commands []string } -func (s *StepPreMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPreMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) device := state.Get("device").(string) ui := state.Get("ui").(packer.Ui) @@ -26,11 +26,11 @@ func (s *StepPreMountCommands) Run(_ context.Context, state multistep.StateBag) return multistep.ActionContinue } - ctx := config.ctx - ctx.Data = &preMountCommandsData{Device: device} + ictx := config.ctx + ictx.Data = &preMountCommandsData{Device: device} ui.Say("Running device setup commands...") - if err := RunLocalCommands(s.Commands, wrappedCommand, ctx, ui); err != nil { + if err := RunLocalCommands(s.Commands, wrappedCommand, ictx, ui); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt diff --git a/builder/amazon/chroot/step_prepare_device.go b/builder/amazon/chroot/step_prepare_device.go index 0939d33cd..7006d7f49 100644 --- a/builder/amazon/chroot/step_prepare_device.go +++ b/builder/amazon/chroot/step_prepare_device.go @@ -14,7 +14,7 @@ import ( type StepPrepareDevice struct { } -func (s *StepPrepareDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPrepareDevice) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_cleanup_volumes.go b/builder/amazon/common/step_cleanup_volumes.go index f805681bf..3ddd27913 100644 --- a/builder/amazon/common/step_cleanup_volumes.go +++ b/builder/amazon/common/step_cleanup_volumes.go @@ -17,7 +17,7 @@ type StepCleanupVolumes struct { BlockDevices BlockDevices } -func (s *StepCleanupVolumes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCleanupVolumes) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // stepCleanupVolumes is for Cleanup only return multistep.ActionContinue } diff --git a/builder/amazon/common/step_create_tags.go b/builder/amazon/common/step_create_tags.go index 95a736a6b..c7d3fb155 100644 --- a/builder/amazon/common/step_create_tags.go +++ b/builder/amazon/common/step_create_tags.go @@ -20,7 +20,7 @@ type StepCreateTags struct { Ctx interpolate.Context } -func (s *StepCreateTags) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateTags) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_deregister_ami.go b/builder/amazon/common/step_deregister_ami.go index 69d623ba6..c593862e0 100644 --- a/builder/amazon/common/step_deregister_ami.go +++ b/builder/amazon/common/step_deregister_ami.go @@ -18,7 +18,7 @@ type StepDeregisterAMI struct { Regions []string } -func (s *StepDeregisterAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDeregisterAMI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Check for force deregister if !s.ForceDeregister { return multistep.ActionContinue diff --git a/builder/amazon/common/step_get_password.go b/builder/amazon/common/step_get_password.go index 1810cd506..96e49b0b0 100644 --- a/builder/amazon/common/step_get_password.go +++ b/builder/amazon/common/step_get_password.go @@ -27,7 +27,7 @@ type StepGetPassword struct { BuildName string } -func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepGetPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) // Skip if we're not using winrm diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index ba72b5668..5ae534cc2 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -20,7 +20,7 @@ type StepKeyPair struct { doCleanup bool } -func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/amazon/common/step_modify_ami_attributes.go b/builder/amazon/common/step_modify_ami_attributes.go index 234e1762a..f6e969578 100644 --- a/builder/amazon/common/step_modify_ami_attributes.go +++ b/builder/amazon/common/step_modify_ami_attributes.go @@ -22,7 +22,7 @@ type StepModifyAMIAttributes struct { Ctx interpolate.Context } -func (s *StepModifyAMIAttributes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepModifyAMIAttributes) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_modify_ebs_instance.go b/builder/amazon/common/step_modify_ebs_instance.go index 8e8b830b4..a8e5a256e 100644 --- a/builder/amazon/common/step_modify_ebs_instance.go +++ b/builder/amazon/common/step_modify_ebs_instance.go @@ -16,7 +16,7 @@ type StepModifyEBSBackedInstance struct { EnableAMISriovNetSupport bool } -func (s *StepModifyEBSBackedInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepModifyEBSBackedInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_network_info.go b/builder/amazon/common/step_network_info.go index 27cd99d73..0c9e9946e 100644 --- a/builder/amazon/common/step_network_info.go +++ b/builder/amazon/common/step_network_info.go @@ -45,7 +45,7 @@ func mostFreeSubnet(subnets []*ec2.Subnet) *ec2.Subnet { return sortedSubnets[len(sortedSubnets)-1] } -func (s *StepNetworkInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepNetworkInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_pre_validate.go b/builder/amazon/common/step_pre_validate.go index 00bed605d..fca189934 100644 --- a/builder/amazon/common/step_pre_validate.go +++ b/builder/amazon/common/step_pre_validate.go @@ -21,7 +21,7 @@ type StepPreValidate struct { ForceDeregister bool } -func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPreValidate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if accessConfig, ok := state.GetOk("access_config"); ok { diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index f799b23b7..9b0b15829 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -25,7 +25,7 @@ type StepSecurityGroup struct { createdGroupId string } -func (s *StepSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) vpcId := state.Get("vpc_id").(string) diff --git a/builder/amazon/common/step_source_ami_info.go b/builder/amazon/common/step_source_ami_info.go index 8ebeb580b..09bbe53e8 100644 --- a/builder/amazon/common/step_source_ami_info.go +++ b/builder/amazon/common/step_source_ami_info.go @@ -42,7 +42,7 @@ func mostRecentAmi(images []*ec2.Image) *ec2.Image { return sortedImages[len(sortedImages)-1] } -func (s *StepSourceAMIInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSourceAMIInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/tags.go b/builder/amazon/common/tags.go index 918269f91..750ad1184 100644 --- a/builder/amazon/common/tags.go +++ b/builder/amazon/common/tags.go @@ -24,16 +24,16 @@ func (t TagMap) IsSet() bool { return len(t) > 0 } -func (t TagMap) EC2Tags(ctx interpolate.Context, region string, state multistep.StateBag) (EC2Tags, error) { +func (t TagMap) EC2Tags(ictx interpolate.Context, region string, state multistep.StateBag) (EC2Tags, error) { var ec2Tags []*ec2.Tag - ctx.Data = extractBuildInfo(region, state) + ictx.Data = extractBuildInfo(region, state) for key, value := range t { - interpolatedKey, err := interpolate.Render(key, &ctx) + interpolatedKey, err := interpolate.Render(key, &ictx) if err != nil { return nil, fmt.Errorf("Error processing tag: %s:%s - %s", key, value, err) } - interpolatedValue, err := interpolate.Render(value, &ctx) + interpolatedValue, err := interpolate.Render(value, &ictx) if err != nil { return nil, fmt.Errorf("Error processing tag: %s:%s - %s", key, value, err) } diff --git a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go index 62a84146c..eee1882b6 100644 --- a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go +++ b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go @@ -15,7 +15,7 @@ type stepTagEBSVolumes struct { Ctx interpolate.Context } -func (s *stepTagEBSVolumes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepTagEBSVolumes) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/instance/step_bundle_volume.go b/builder/amazon/instance/step_bundle_volume.go index 1c8b006b8..bbac89170 100644 --- a/builder/amazon/instance/step_bundle_volume.go +++ b/builder/amazon/instance/step_bundle_volume.go @@ -24,7 +24,7 @@ type StepBundleVolume struct { Debug bool } -func (s *StepBundleVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepBundleVolume) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/instance/step_upload_bundle.go b/builder/amazon/instance/step_upload_bundle.go index 1e7711d42..c99d24e61 100644 --- a/builder/amazon/instance/step_upload_bundle.go +++ b/builder/amazon/instance/step_upload_bundle.go @@ -23,7 +23,7 @@ type StepUploadBundle struct { Debug bool } -func (s *StepUploadBundle) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadBundle) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) manifestName := state.Get("manifest_name").(string) diff --git a/builder/amazon/instance/step_upload_x509_cert.go b/builder/amazon/instance/step_upload_x509_cert.go index 14ea955e5..9295d50df 100644 --- a/builder/amazon/instance/step_upload_x509_cert.go +++ b/builder/amazon/instance/step_upload_x509_cert.go @@ -11,7 +11,7 @@ import ( type StepUploadX509Cert struct{} -func (s *StepUploadX509Cert) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadX509Cert) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/azure/arm/step_capture_image_test.go b/builder/azure/arm/step_capture_image_test.go index 10b6a0010..996736391 100644 --- a/builder/azure/arm/step_capture_image_test.go +++ b/builder/azure/arm/step_capture_image_test.go @@ -74,7 +74,7 @@ func TestStepCaptureImageShouldTakeStepArgumentsFromStateBag(t *testing.T) { } var testSubject = &StepCaptureImage{ - captureVhd: func(_ context.Context, resourceGroupName string, computeName string, parameters *compute.VirtualMachineCaptureParameters) error { + captureVhd: func(ctx context.Context, resourceGroupName string, computeName string, parameters *compute.VirtualMachineCaptureParameters) error { actualResourceGroupName = resourceGroupName actualComputeName = computeName actualVirtualMachineCaptureParameters = parameters diff --git a/builder/azure/arm/step_create_resource_group_test.go b/builder/azure/arm/step_create_resource_group_test.go index aa8fe2c2f..cb8707fbe 100644 --- a/builder/azure/arm/step_create_resource_group_test.go +++ b/builder/azure/arm/step_create_resource_group_test.go @@ -105,7 +105,7 @@ func TestStepCreateResourceGroupShouldTakeStepArgumentsFromStateBag(t *testing.T var actualTags map[string]*string var testSubject = &StepCreateResourceGroup{ - create: func(_ context.Context, resourceGroupName string, location string, tags map[string]*string) error { + create: func(ctx context.Context, resourceGroupName string, location string, tags map[string]*string) error { actualResourceGroupName = resourceGroupName actualLocation = location actualTags = tags diff --git a/builder/azure/arm/step_deploy_template_test.go b/builder/azure/arm/step_deploy_template_test.go index d9dce1d60..329a36fde 100644 --- a/builder/azure/arm/step_deploy_template_test.go +++ b/builder/azure/arm/step_deploy_template_test.go @@ -54,7 +54,7 @@ func TestStepDeployTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) { var actualDeploymentName string var testSubject = &StepDeployTemplate{ - deploy: func(_ context.Context, resourceGroupName string, deploymentName string) error { + deploy: func(ctx context.Context, resourceGroupName string, deploymentName string) error { actualResourceGroupName = resourceGroupName actualDeploymentName = deploymentName diff --git a/builder/azure/arm/step_get_certificate.go b/builder/azure/arm/step_get_certificate.go index 784826771..2c05bf191 100644 --- a/builder/azure/arm/step_get_certificate.go +++ b/builder/azure/arm/step_get_certificate.go @@ -40,7 +40,7 @@ func (s *StepGetCertificate) getCertificateUrl(keyVaultName string, secretName s return *secret.ID, err } -func (s *StepGetCertificate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepGetCertificate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.say("Getting the certificate's URL ...") var keyVaultName = state.Get(constants.ArmKeyVaultName).(string) diff --git a/builder/azure/arm/step_save_winrm_password.go b/builder/azure/arm/step_save_winrm_password.go index 3afac5ccf..c23c6b26b 100644 --- a/builder/azure/arm/step_save_winrm_password.go +++ b/builder/azure/arm/step_save_winrm_password.go @@ -13,7 +13,7 @@ type StepSaveWinRMPassword struct { BuildName string } -func (s *StepSaveWinRMPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSaveWinRMPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // store so that we can access this later during provisioning commonhelper.SetSharedState("winrm_password", s.Password, s.BuildName) packer.LogSecretFilter.Set(s.Password) diff --git a/builder/azure/arm/step_set_certificate.go b/builder/azure/arm/step_set_certificate.go index ef8832074..46621e306 100644 --- a/builder/azure/arm/step_set_certificate.go +++ b/builder/azure/arm/step_set_certificate.go @@ -24,7 +24,7 @@ func NewStepSetCertificate(config *Config, ui packer.Ui) *StepSetCertificate { return step } -func (s *StepSetCertificate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSetCertificate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.say("Setting the certificate's URL ...") var winRMCertificateUrl = state.Get(constants.ArmCertificateUrl).(string) diff --git a/builder/cloudstack/step_configure_networking.go b/builder/cloudstack/step_configure_networking.go index 39636b54f..17ee7d92f 100644 --- a/builder/cloudstack/step_configure_networking.go +++ b/builder/cloudstack/step_configure_networking.go @@ -17,7 +17,7 @@ type stepSetupNetworking struct { publicPort int } -func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSetupNetworking) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_instance.go b/builder/cloudstack/step_create_instance.go index 6cc97ae0a..d20b19f56 100644 --- a/builder/cloudstack/step_create_instance.go +++ b/builder/cloudstack/step_create_instance.go @@ -28,7 +28,7 @@ type stepCreateInstance struct { } // Run executes the Packer build step that creates a CloudStack instance. -func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_security_group.go b/builder/cloudstack/step_create_security_group.go index c42eec5d5..e8a1f1818 100644 --- a/builder/cloudstack/step_create_security_group.go +++ b/builder/cloudstack/step_create_security_group.go @@ -14,7 +14,7 @@ type stepCreateSecurityGroup struct { tempSG string } -func (s *stepCreateSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_template.go b/builder/cloudstack/step_create_template.go index 706d570f6..4b72d206d 100644 --- a/builder/cloudstack/step_create_template.go +++ b/builder/cloudstack/step_create_template.go @@ -12,7 +12,7 @@ import ( type stepCreateTemplate struct{} -func (s *stepCreateTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_keypair.go b/builder/cloudstack/step_keypair.go index bb40534fe..b47655596 100644 --- a/builder/cloudstack/step_keypair.go +++ b/builder/cloudstack/step_keypair.go @@ -18,7 +18,7 @@ type stepKeypair struct { DebugKeyPath string } -func (s *stepKeypair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepKeypair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/cloudstack/step_prepare_config.go b/builder/cloudstack/step_prepare_config.go index 644547018..7c6e1a4ff 100644 --- a/builder/cloudstack/step_prepare_config.go +++ b/builder/cloudstack/step_prepare_config.go @@ -13,7 +13,7 @@ import ( type stepPrepareConfig struct{} -func (s *stepPrepareConfig) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPrepareConfig) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_shutdown_instance.go b/builder/cloudstack/step_shutdown_instance.go index a7f07e8b2..77186e13b 100644 --- a/builder/cloudstack/step_shutdown_instance.go +++ b/builder/cloudstack/step_shutdown_instance.go @@ -11,7 +11,7 @@ import ( type stepShutdownInstance struct{} -func (s *stepShutdownInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShutdownInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index cfb1f4203..a64325d35 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -15,7 +15,7 @@ type stepCreateDroplet struct { dropletId int } -func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDroplet) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/digitalocean/step_create_ssh_key.go b/builder/digitalocean/step_create_ssh_key.go index e60a0edad..d8256b65b 100644 --- a/builder/digitalocean/step_create_ssh_key.go +++ b/builder/digitalocean/step_create_ssh_key.go @@ -25,7 +25,7 @@ type stepCreateSSHKey struct { keyId int } -func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/digitalocean/step_droplet_info.go b/builder/digitalocean/step_droplet_info.go index 26c990d22..dc7a9ed8a 100644 --- a/builder/digitalocean/step_droplet_info.go +++ b/builder/digitalocean/step_droplet_info.go @@ -11,7 +11,7 @@ import ( type stepDropletInfo struct{} -func (s *stepDropletInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepDropletInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/digitalocean/step_power_off.go b/builder/digitalocean/step_power_off.go index 0ca9d6fc7..fab35569a 100644 --- a/builder/digitalocean/step_power_off.go +++ b/builder/digitalocean/step_power_off.go @@ -12,7 +12,7 @@ import ( type stepPowerOff struct{} -func (s *stepPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPowerOff) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_shutdown.go b/builder/digitalocean/step_shutdown.go index 248aadd0a..339e034b7 100644 --- a/builder/digitalocean/step_shutdown.go +++ b/builder/digitalocean/step_shutdown.go @@ -13,7 +13,7 @@ import ( type stepShutdown struct{} -func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_snapshot.go b/builder/digitalocean/step_snapshot.go index ed1cd7faf..f3c9430f1 100644 --- a/builder/digitalocean/step_snapshot.go +++ b/builder/digitalocean/step_snapshot.go @@ -14,7 +14,7 @@ import ( type stepSnapshot struct{} -func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/docker/driver_docker.go b/builder/docker/driver_docker.go index 918dfdb2c..54e17b8d8 100644 --- a/builder/docker/driver_docker.go +++ b/builder/docker/driver_docker.go @@ -261,8 +261,8 @@ func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error) { // Build up the template data var tplData startContainerTemplate tplData.Image = config.Image - ctx := *d.Ctx - ctx.Data = &tplData + ictx := *d.Ctx + ictx.Data = &tplData // Args that we're going to pass to Docker args := []string{"run"} @@ -278,7 +278,7 @@ func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error) { args = append(args, "-v", fmt.Sprintf("%s:%s", host, guest)) } for _, v := range config.RunCommand { - v, err := interpolate.Render(v, &ctx) + v, err := interpolate.Render(v, &ictx) if err != nil { return "", err } diff --git a/builder/docker/step_commit.go b/builder/docker/step_commit.go index d248ee64c..943ebbaf3 100644 --- a/builder/docker/step_commit.go +++ b/builder/docker/step_commit.go @@ -13,7 +13,7 @@ type StepCommit struct { imageId string } -func (s *StepCommit) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCommit) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) containerId := state.Get("container_id").(string) config := state.Get("config").(*Config) diff --git a/builder/docker/step_connect_docker.go b/builder/docker/step_connect_docker.go index ef0222a91..d89857942 100644 --- a/builder/docker/step_connect_docker.go +++ b/builder/docker/step_connect_docker.go @@ -11,7 +11,7 @@ import ( type StepConnectDocker struct{} -func (s *StepConnectDocker) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConnectDocker) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) containerId := state.Get("container_id").(string) driver := state.Get("driver").(Driver) diff --git a/builder/docker/step_export.go b/builder/docker/step_export.go index 138e0f00c..b02228036 100644 --- a/builder/docker/step_export.go +++ b/builder/docker/step_export.go @@ -13,7 +13,7 @@ import ( // StepExport exports the container to a flat tar file. type StepExport struct{} -func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) diff --git a/builder/docker/step_pull.go b/builder/docker/step_pull.go index fd011680e..712ef70c7 100644 --- a/builder/docker/step_pull.go +++ b/builder/docker/step_pull.go @@ -11,7 +11,7 @@ import ( type StepPull struct{} -func (s *StepPull) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPull) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/docker/step_run.go b/builder/docker/step_run.go index 1d2ba6862..a6a0ca838 100644 --- a/builder/docker/step_run.go +++ b/builder/docker/step_run.go @@ -12,7 +12,7 @@ type StepRun struct { containerId string } -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) tempDir := state.Get("temp_dir").(string) diff --git a/builder/docker/step_temp_dir.go b/builder/docker/step_temp_dir.go index c87c33885..827236a15 100644 --- a/builder/docker/step_temp_dir.go +++ b/builder/docker/step_temp_dir.go @@ -37,7 +37,7 @@ func ConfigTmpDir() (string, error) { return td, nil } -func (s *StepTempDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepTempDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating a temporary directory for sharing data...") diff --git a/builder/googlecompute/step_check_existing_image.go b/builder/googlecompute/step_check_existing_image.go index ac11600e1..0574a0234 100644 --- a/builder/googlecompute/step_check_existing_image.go +++ b/builder/googlecompute/step_check_existing_image.go @@ -13,7 +13,7 @@ import ( type StepCheckExistingImage int // Run executes the Packer build step that checks if the image already exists. -func (s *StepCheckExistingImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCheckExistingImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) d := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_create_image.go b/builder/googlecompute/step_create_image.go index c2bde16c8..dd3770014 100644 --- a/builder/googlecompute/step_create_image.go +++ b/builder/googlecompute/step_create_image.go @@ -18,7 +18,7 @@ type StepCreateImage int // // The image is created from the persistent disk used by the instance. The // instance must be deleted and the disk retained before doing this step. -func (s *StepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 5e0592894..5ed854670 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -73,7 +73,7 @@ func getImage(c *Config, d Driver) (*Image, error) { } // Run executes the Packer build step that creates a GCE instance. -func (s *StepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) d := state.Get("driver").(Driver) diff --git a/builder/googlecompute/step_create_ssh_key.go b/builder/googlecompute/step_create_ssh_key.go index 897e0a6a3..416657b7d 100644 --- a/builder/googlecompute/step_create_ssh_key.go +++ b/builder/googlecompute/step_create_ssh_key.go @@ -22,7 +22,7 @@ type StepCreateSSHKey struct { // Run executes the Packer build step that generates SSH key pairs. // The key pairs are added to the ssh config -func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/googlecompute/step_create_windows_password.go b/builder/googlecompute/step_create_windows_password.go index 2b85aa2ed..fda606245 100644 --- a/builder/googlecompute/step_create_windows_password.go +++ b/builder/googlecompute/step_create_windows_password.go @@ -25,7 +25,7 @@ type StepCreateWindowsPassword struct { } // Run executes the Packer build step that sets the windows password on a Windows GCE instance. -func (s *StepCreateWindowsPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateWindowsPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) d := state.Get("driver").(Driver) c := state.Get("config").(*Config) diff --git a/builder/googlecompute/step_instance_info.go b/builder/googlecompute/step_instance_info.go index d67984b75..1809fbb84 100644 --- a/builder/googlecompute/step_instance_info.go +++ b/builder/googlecompute/step_instance_info.go @@ -17,7 +17,7 @@ type StepInstanceInfo struct { // Run executes the Packer build step that gathers GCE instance info. // This adds "instance_ip" to the multistep state. -func (s *StepInstanceInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepInstanceInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_teardown_instance.go b/builder/googlecompute/step_teardown_instance.go index 27f9fee35..c992dead3 100644 --- a/builder/googlecompute/step_teardown_instance.go +++ b/builder/googlecompute/step_teardown_instance.go @@ -17,7 +17,7 @@ type StepTeardownInstance struct { } // Run executes the Packer build step that tears down a GCE instance. -func (s *StepTeardownInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepTeardownInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_wait_startup_script.go b/builder/googlecompute/step_wait_startup_script.go index efc2a78f7..e68fa1d2b 100644 --- a/builder/googlecompute/step_wait_startup_script.go +++ b/builder/googlecompute/step_wait_startup_script.go @@ -14,7 +14,7 @@ type StepWaitStartupScript int // Run reads the instance metadata and looks for the log entry // indicating the startup script finished. -func (s *StepWaitStartupScript) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitStartupScript) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperone/builder.go b/builder/hyperone/builder.go index 2199623f5..d9e85e5f0 100644 --- a/builder/hyperone/builder.go +++ b/builder/hyperone/builder.go @@ -52,9 +52,9 @@ type wrappedCommandTemplate struct { func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { wrappedCommand := func(command string) (string, error) { - ctx := b.config.ctx - ctx.Data = &wrappedCommandTemplate{Command: command} - return interpolate.Render(b.config.ChrootCommandWrapper, &ctx) + ictx := b.config.ctx + ictx.Data = &wrappedCommandTemplate{Command: command} + return interpolate.Render(b.config.ChrootCommandWrapper, &ictx) } state := &multistep.BasicStateBag{} diff --git a/builder/hyperone/step_copy_files.go b/builder/hyperone/step_copy_files.go index 685f4ab5d..739b76e62 100644 --- a/builder/hyperone/step_copy_files.go +++ b/builder/hyperone/step_copy_files.go @@ -12,7 +12,7 @@ import ( type stepCopyFiles struct{} -func (s *stepCopyFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCopyFiles) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperone/step_create_ssh_key.go b/builder/hyperone/step_create_ssh_key.go index 15dd34f2a..3bf19fe33 100644 --- a/builder/hyperone/step_create_ssh_key.go +++ b/builder/hyperone/step_create_ssh_key.go @@ -20,7 +20,7 @@ type stepCreateSSHKey struct { DebugKeyPath string } -func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) ui.Say("Creating a temporary ssh key for the VM...") diff --git a/builder/hyperone/step_mount_extra.go b/builder/hyperone/step_mount_extra.go index 0449b6a3f..ae798526e 100644 --- a/builder/hyperone/step_mount_extra.go +++ b/builder/hyperone/step_mount_extra.go @@ -10,7 +10,7 @@ import ( type stepMountExtra struct{} -func (s *stepMountExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepMountExtra) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperone/step_post_mount_commands.go b/builder/hyperone/step_post_mount_commands.go index e0f3ff502..5fc074263 100644 --- a/builder/hyperone/step_post_mount_commands.go +++ b/builder/hyperone/step_post_mount_commands.go @@ -14,19 +14,19 @@ type postMountCommandsData struct { type stepPostMountCommands struct{} -func (s *stepPostMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPostMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) device := state.Get("device").(string) - ctx := config.ctx - ctx.Data = &postMountCommandsData{ + ictx := config.ctx + ictx.Data = &postMountCommandsData{ Device: device, MountPath: config.ChrootMountPath, } ui.Say("Running post-mount commands...") - if err := runCommands(config.PostMountCommands, ctx, state); err != nil { + if err := runCommands(config.PostMountCommands, ictx, state); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt diff --git a/builder/hyperone/step_pre_mount_commands.go b/builder/hyperone/step_pre_mount_commands.go index 459bff6c3..4a1e4dd11 100644 --- a/builder/hyperone/step_pre_mount_commands.go +++ b/builder/hyperone/step_pre_mount_commands.go @@ -14,19 +14,19 @@ type preMountCommandsData struct { type stepPreMountCommands struct{} -func (s *stepPreMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPreMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) device := state.Get("device").(string) - ctx := config.ctx - ctx.Data = &preMountCommandsData{ + ictx := config.ctx + ictx.Data = &preMountCommandsData{ Device: device, MountPath: config.ChrootMountPath, } ui.Say("Running pre-mount commands...") - if err := runCommands(config.PreMountCommands, ctx, state); err != nil { + if err := runCommands(config.PreMountCommands, ictx, state); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt diff --git a/builder/hyperone/step_prepare_device.go b/builder/hyperone/step_prepare_device.go index 1a4b74bb0..80cb9c617 100644 --- a/builder/hyperone/step_prepare_device.go +++ b/builder/hyperone/step_prepare_device.go @@ -15,7 +15,7 @@ const ( type stepPrepareDevice struct{} -func (s *stepPrepareDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPrepareDevice) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) controllerNumber := state.Get("chroot_controller_number").(string) controllerLocation := state.Get("chroot_controller_location").(int) diff --git a/builder/hyperone/utils.go b/builder/hyperone/utils.go index cb76ccff9..cbc73c25f 100644 --- a/builder/hyperone/utils.go +++ b/builder/hyperone/utils.go @@ -21,13 +21,13 @@ func formatOpenAPIError(err error) string { return fmt.Sprintf("%s (body: %s)", openAPIError.Error(), openAPIError.Body()) } -func runCommands(commands []string, ctx interpolate.Context, state multistep.StateBag) error { +func runCommands(commands []string, ictx interpolate.Context, state multistep.StateBag) error { ui := state.Get("ui").(packer.Ui) wrappedCommand := state.Get("wrappedCommand").(CommandWrapper) comm := state.Get("communicator").(packer.Communicator) for _, rawCmd := range commands { - intCmd, err := interpolate.Render(rawCmd, &ctx) + intCmd, err := interpolate.Render(rawCmd, &ictx) if err != nil { return fmt.Errorf("error interpolating: %s", err) } diff --git a/builder/hyperv/common/step_clone_vm.go b/builder/hyperv/common/step_clone_vm.go index 09e063db3..10a8cd7e4 100644 --- a/builder/hyperv/common/step_clone_vm.go +++ b/builder/hyperv/common/step_clone_vm.go @@ -33,7 +33,7 @@ type StepCloneVM struct { MacAddress string } -func (s *StepCloneVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCloneVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Cloning virtual machine...") diff --git a/builder/hyperv/common/step_collate_artifacts.go b/builder/hyperv/common/step_collate_artifacts.go index 2e40a532f..580ba28d0 100644 --- a/builder/hyperv/common/step_collate_artifacts.go +++ b/builder/hyperv/common/step_collate_artifacts.go @@ -15,7 +15,7 @@ type StepCollateArtifacts struct { // Runs the step required to collate all build artifacts under the // specified output directory -func (s *StepCollateArtifacts) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCollateArtifacts) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_compact_disk.go b/builder/hyperv/common/step_compact_disk.go index ebaa9978e..437473b16 100644 --- a/builder/hyperv/common/step_compact_disk.go +++ b/builder/hyperv/common/step_compact_disk.go @@ -13,7 +13,7 @@ type StepCompactDisk struct { } // Run runs a compaction/optimisation process on attached VHD/VHDX disks -func (s *StepCompactDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCompactDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_configure_ip.go b/builder/hyperv/common/step_configure_ip.go index 41d945a0d..5e5baac31 100644 --- a/builder/hyperv/common/step_configure_ip.go +++ b/builder/hyperv/common/step_configure_ip.go @@ -14,7 +14,7 @@ import ( type StepConfigureIp struct { } -func (s *StepConfigureIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_configure_vlan.go b/builder/hyperv/common/step_configure_vlan.go index a167b9ed1..60d8fdf3a 100644 --- a/builder/hyperv/common/step_configure_vlan.go +++ b/builder/hyperv/common/step_configure_vlan.go @@ -13,7 +13,7 @@ type StepConfigureVlan struct { SwitchVlanId string } -func (s *StepConfigureVlan) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVlan) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_build_dir.go b/builder/hyperv/common/step_create_build_dir.go index 34148c41f..dc6b69a04 100644 --- a/builder/hyperv/common/step_create_build_dir.go +++ b/builder/hyperv/common/step_create_build_dir.go @@ -25,7 +25,7 @@ type StepCreateBuildDir struct { // Creates the main directory used to house the VMs files and folders // during the build -func (s *StepCreateBuildDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateBuildDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating build directory...") diff --git a/builder/hyperv/common/step_create_external_switch.go b/builder/hyperv/common/step_create_external_switch.go index 483dc2c2c..c5ebd43bf 100644 --- a/builder/hyperv/common/step_create_external_switch.go +++ b/builder/hyperv/common/step_create_external_switch.go @@ -21,7 +21,7 @@ type StepCreateExternalSwitch struct { // Run runs the step required to create an external switch. Depending on // the connectivity of the host machine, the external switch will allow the // build VM to connect to the outside world. -func (s *StepCreateExternalSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateExternalSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_switch.go b/builder/hyperv/common/step_create_switch.go index 4b5ef48e2..7ea5f5c24 100644 --- a/builder/hyperv/common/step_create_switch.go +++ b/builder/hyperv/common/step_create_switch.go @@ -33,7 +33,7 @@ type StepCreateSwitch struct { createdSwitch bool } -func (s *StepCreateSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSwitch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index d33ece72e..f205437cb 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -37,7 +37,7 @@ type StepCreateVM struct { Version string } -func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Creating virtual machine...") diff --git a/builder/hyperv/common/step_disable_vlan.go b/builder/hyperv/common/step_disable_vlan.go index 0d4882ec1..3bae16d7c 100644 --- a/builder/hyperv/common/step_disable_vlan.go +++ b/builder/hyperv/common/step_disable_vlan.go @@ -11,7 +11,7 @@ import ( type StepDisableVlan struct { } -func (s *StepDisableVlan) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDisableVlan) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_enable_integration_service.go b/builder/hyperv/common/step_enable_integration_service.go index e3f8fd70a..25675b749 100644 --- a/builder/hyperv/common/step_enable_integration_service.go +++ b/builder/hyperv/common/step_enable_integration_service.go @@ -12,7 +12,7 @@ type StepEnableIntegrationService struct { name string } -func (s *StepEnableIntegrationService) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepEnableIntegrationService) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Enabling Integration Service...") diff --git a/builder/hyperv/common/step_export_vm.go b/builder/hyperv/common/step_export_vm.go index 6b543407d..08513d0f7 100644 --- a/builder/hyperv/common/step_export_vm.go +++ b/builder/hyperv/common/step_export_vm.go @@ -14,7 +14,7 @@ type StepExportVm struct { SkipExport bool } -func (s *StepExportVm) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepExportVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index 945c6a86d..88b084c6c 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -15,7 +15,7 @@ type StepMountDvdDrive struct { Generation uint } -func (s *StepMountDvdDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountDvdDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_mount_floppydrive.go b/builder/hyperv/common/step_mount_floppydrive.go index 31b4c794a..5ded58d29 100644 --- a/builder/hyperv/common/step_mount_floppydrive.go +++ b/builder/hyperv/common/step_mount_floppydrive.go @@ -22,7 +22,7 @@ type StepMountFloppydrive struct { floppyPath string } -func (s *StepMountFloppydrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountFloppydrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if s.Generation > 1 { return multistep.ActionContinue } diff --git a/builder/hyperv/common/step_mount_guest_additions.go b/builder/hyperv/common/step_mount_guest_additions.go index d333c5baf..852e8e274 100644 --- a/builder/hyperv/common/step_mount_guest_additions.go +++ b/builder/hyperv/common/step_mount_guest_additions.go @@ -15,7 +15,7 @@ type StepMountGuestAdditions struct { Generation uint } -func (s *StepMountGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.GuestAdditionsMode != "attach" { diff --git a/builder/hyperv/common/step_mount_secondary_dvd_images.go b/builder/hyperv/common/step_mount_secondary_dvd_images.go index 22563376b..4303f51f4 100644 --- a/builder/hyperv/common/step_mount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_mount_secondary_dvd_images.go @@ -20,7 +20,7 @@ type DvdControllerProperties struct { Existing bool } -func (s *StepMountSecondaryDvdImages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepMountSecondaryDvdImages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Mounting secondary DVD images...") diff --git a/builder/hyperv/common/step_polling_installation.go b/builder/hyperv/common/step_polling_installation.go index 133418ee7..40754f725 100644 --- a/builder/hyperv/common/step_polling_installation.go +++ b/builder/hyperv/common/step_polling_installation.go @@ -18,7 +18,7 @@ const port string = "13000" type StepPollingInstallation struct { } -func (s *StepPollingInstallation) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPollingInstallation) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) errorMsg := "Error polling VM: %s" diff --git a/builder/hyperv/common/step_reboot_vm.go b/builder/hyperv/common/step_reboot_vm.go index 8e2bec1b8..b2053804f 100644 --- a/builder/hyperv/common/step_reboot_vm.go +++ b/builder/hyperv/common/step_reboot_vm.go @@ -12,7 +12,7 @@ import ( type StepRebootVm struct { } -func (s *StepRebootVm) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRebootVm) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_run.go b/builder/hyperv/common/step_run.go index bb415ffa1..a897b203e 100644 --- a/builder/hyperv/common/step_run.go +++ b/builder/hyperv/common/step_run.go @@ -15,7 +15,7 @@ type StepRun struct { vmName string } -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/hyperv/common/step_shutdown.go b/builder/hyperv/common/step_shutdown.go index ddfdf3388..a80a07542 100644 --- a/builder/hyperv/common/step_shutdown.go +++ b/builder/hyperv/common/step_shutdown.go @@ -28,7 +28,7 @@ type StepShutdown struct { Timeout time.Duration } -func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) diff --git a/builder/hyperv/common/step_sleep.go b/builder/hyperv/common/step_sleep.go index e7ed01cca..1bbcfac56 100644 --- a/builder/hyperv/common/step_sleep.go +++ b/builder/hyperv/common/step_sleep.go @@ -14,7 +14,7 @@ type StepSleep struct { ActionName string } -func (s *StepSleep) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSleep) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if len(s.ActionName) > 0 { diff --git a/builder/hyperv/common/step_unmount_dvddrive.go b/builder/hyperv/common/step_unmount_dvddrive.go index 50298f6e1..665d00808 100644 --- a/builder/hyperv/common/step_unmount_dvddrive.go +++ b/builder/hyperv/common/step_unmount_dvddrive.go @@ -11,7 +11,7 @@ import ( type StepUnmountDvdDrive struct { } -func (s *StepUnmountDvdDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountDvdDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_floppydrive.go b/builder/hyperv/common/step_unmount_floppydrive.go index 34f09aaa0..7c212ce5c 100644 --- a/builder/hyperv/common/step_unmount_floppydrive.go +++ b/builder/hyperv/common/step_unmount_floppydrive.go @@ -12,7 +12,7 @@ type StepUnmountFloppyDrive struct { Generation uint } -func (s *StepUnmountFloppyDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountFloppyDrive) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_guest_additions.go b/builder/hyperv/common/step_unmount_guest_additions.go index c7f78cf52..bb51eb7ce 100644 --- a/builder/hyperv/common/step_unmount_guest_additions.go +++ b/builder/hyperv/common/step_unmount_guest_additions.go @@ -11,7 +11,7 @@ import ( type StepUnmountGuestAdditions struct { } -func (s *StepUnmountGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_secondary_dvd_images.go b/builder/hyperv/common/step_unmount_secondary_dvd_images.go index 06bd2e0db..9cf192d4d 100644 --- a/builder/hyperv/common/step_unmount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_unmount_secondary_dvd_images.go @@ -11,7 +11,7 @@ import ( type StepUnmountSecondaryDvdImages struct { } -func (s *StepUnmountSecondaryDvdImages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountSecondaryDvdImages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/hyperv/common/step_wait_for_install_to_complete.go b/builder/hyperv/common/step_wait_for_install_to_complete.go index 0a40730b3..265eb6572 100644 --- a/builder/hyperv/common/step_wait_for_install_to_complete.go +++ b/builder/hyperv/common/step_wait_for_install_to_complete.go @@ -16,7 +16,7 @@ const ( type StepWaitForPowerOff struct { } -func (s *StepWaitForPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForPowerOff) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) @@ -50,7 +50,7 @@ type StepWaitForInstallToComplete struct { ActionName string } -func (s *StepWaitForInstallToComplete) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForInstallToComplete) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/lxc/step_export.go b/builder/lxc/step_export.go index b6f5aca5f..52fd6e546 100644 --- a/builder/lxc/step_export.go +++ b/builder/lxc/step_export.go @@ -15,7 +15,7 @@ import ( type stepExport struct{} -func (s *stepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_lxc_create.go b/builder/lxc/step_lxc_create.go index 1526ed715..c09626cd1 100644 --- a/builder/lxc/step_lxc_create.go +++ b/builder/lxc/step_lxc_create.go @@ -13,7 +13,7 @@ import ( type stepLxcCreate struct{} -func (s *stepLxcCreate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepLxcCreate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_prepare_output_dir.go b/builder/lxc/step_prepare_output_dir.go index 25479fd8a..5537c5a8c 100644 --- a/builder/lxc/step_prepare_output_dir.go +++ b/builder/lxc/step_prepare_output_dir.go @@ -12,7 +12,7 @@ import ( type stepPrepareOutputDir struct{} -func (stepPrepareOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (stepPrepareOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index 4e055a690..5b7873cb4 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -16,7 +16,7 @@ type StepWaitInit struct { WaitTimeout time.Duration } -func (s *StepWaitInit) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitInit) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var err error diff --git a/builder/lxd/step_lxd_launch.go b/builder/lxd/step_lxd_launch.go index a2baf2b11..7bff6fd42 100644 --- a/builder/lxd/step_lxd_launch.go +++ b/builder/lxd/step_lxd_launch.go @@ -13,7 +13,7 @@ import ( type stepLxdLaunch struct{} -func (s *stepLxdLaunch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepLxdLaunch) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxd/step_publish.go b/builder/lxd/step_publish.go index 4dc21880f..461f3a9bd 100644 --- a/builder/lxd/step_publish.go +++ b/builder/lxd/step_publish.go @@ -11,7 +11,7 @@ import ( type stepPublish struct{} -func (s *stepPublish) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPublish) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/ncloud/step_create_block_storage_instance.go b/builder/ncloud/step_create_block_storage_instance.go index b135a15e7..870f81a64 100644 --- a/builder/ncloud/step_create_block_storage_instance.go +++ b/builder/ncloud/step_create_block_storage_instance.go @@ -55,7 +55,7 @@ func (s *StepCreateBlockStorageInstance) createBlockStorageInstance(serverInstan return blockStorageInstanceList.BlockStorageInstance[0].BlockStorageInstanceNo, nil } -func (s *StepCreateBlockStorageInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateBlockStorageInstance) Run(ctx 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_login_key.go b/builder/ncloud/step_create_login_key.go index 05ef97739..95602238a 100644 --- a/builder/ncloud/step_create_login_key.go +++ b/builder/ncloud/step_create_login_key.go @@ -45,7 +45,7 @@ func (s *StepCreateLoginKey) createLoginKey() (*LoginKey, error) { return &LoginKey{KeyName, privateKey.PrivateKey}, nil } -func (s *StepCreateLoginKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateLoginKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Login Key") loginKey, err := s.CreateLoginKey() diff --git a/builder/ncloud/step_create_public_ip_instance.go b/builder/ncloud/step_create_public_ip_instance.go index d4cd72b6d..ce4bac5f3 100644 --- a/builder/ncloud/step_create_public_ip_instance.go +++ b/builder/ncloud/step_create_public_ip_instance.go @@ -85,7 +85,7 @@ func (s *StepCreatePublicIPInstance) createPublicIPInstance(serverInstanceNo str return &publicIPInstance, nil } -func (s *StepCreatePublicIPInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreatePublicIPInstance) Run(ctx 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_server_image.go b/builder/ncloud/step_create_server_image.go index 447485641..a31eff387 100644 --- a/builder/ncloud/step_create_server_image.go +++ b/builder/ncloud/step_create_server_image.go @@ -61,7 +61,7 @@ func (s *StepCreateServerImage) createServerImage(serverInstanceNo string) (*ncl return &serverImage, nil } -func (s *StepCreateServerImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateServerImage) Run(ctx 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_instance.go b/builder/ncloud/step_create_server_instance.go index a8a72586d..2a72789f6 100644 --- a/builder/ncloud/step_create_server_instance.go +++ b/builder/ncloud/step_create_server_instance.go @@ -82,7 +82,7 @@ func (s *StepCreateServerInstance) createServerInstance(loginKeyName string, zon return s.serverInstanceNo, nil } -func (s *StepCreateServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateServerInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Create Server Instance") var loginKey = state.Get("LoginKey").(*LoginKey) diff --git a/builder/ncloud/step_delete_block_storage_instance.go b/builder/ncloud/step_delete_block_storage_instance.go index d43edf1c9..da4961125 100644 --- a/builder/ncloud/step_delete_block_storage_instance.go +++ b/builder/ncloud/step_delete_block_storage_instance.go @@ -78,7 +78,7 @@ func (s *StepDeleteBlockStorageInstance) deleteBlockStorageInstance(serverInstan return nil } -func (s *StepDeleteBlockStorageInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteBlockStorageInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if s.Config.BlockStorageSize == 0 { return processStepResult(nil, s.Error, state) } diff --git a/builder/ncloud/step_get_rootpassword.go b/builder/ncloud/step_get_rootpassword.go index a57058dc6..ab4c61b24 100644 --- a/builder/ncloud/step_get_rootpassword.go +++ b/builder/ncloud/step_get_rootpassword.go @@ -45,7 +45,7 @@ func (s *StepGetRootPassword) getRootPassword(serverInstanceNo string, privateKe return rootPassword.RootPassword, nil } -func (s *StepGetRootPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepGetRootPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Get Root Password") serverInstanceNo := state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_stop_server_instance.go b/builder/ncloud/step_stop_server_instance.go index 293c8e55d..bdd573933 100644 --- a/builder/ncloud/step_stop_server_instance.go +++ b/builder/ncloud/step_stop_server_instance.go @@ -51,7 +51,7 @@ func (s *StepStopServerInstance) stopServerInstance(serverInstanceNo string) err return nil } -func (s *StepStopServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepStopServerInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Stop Server Instance") var serverInstanceNo = state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_terminate_server_instance.go b/builder/ncloud/step_terminate_server_instance.go index f6c8d281a..67a8cb056 100644 --- a/builder/ncloud/step_terminate_server_instance.go +++ b/builder/ncloud/step_terminate_server_instance.go @@ -67,7 +67,7 @@ func (s *StepTerminateServerInstance) terminateServerInstance(serverInstanceNo s } } -func (s *StepTerminateServerInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepTerminateServerInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Terminate Server Instance") var serverInstanceNo = state.Get("InstanceNo").(string) diff --git a/builder/ncloud/step_validate_template.go b/builder/ncloud/step_validate_template.go index 873cd4723..ed67419ec 100644 --- a/builder/ncloud/step_validate_template.go +++ b/builder/ncloud/step_validate_template.go @@ -250,7 +250,7 @@ func (s *StepValidateTemplate) validateTemplate() error { } // Run : main function for validation a template -func (s *StepValidateTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepValidateTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { s.Say("Validating deployment template ...") err := s.Validate() diff --git a/builder/oneandone/step_create_server.go b/builder/oneandone/step_create_server.go index 9b848f92e..f477c0be8 100644 --- a/builder/oneandone/step_create_server.go +++ b/builder/oneandone/step_create_server.go @@ -13,7 +13,7 @@ import ( type stepCreateServer struct{} -func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/oneandone/step_create_sshkey.go b/builder/oneandone/step_create_sshkey.go index 5036e9b57..8a3613560 100644 --- a/builder/oneandone/step_create_sshkey.go +++ b/builder/oneandone/step_create_sshkey.go @@ -17,7 +17,7 @@ type StepCreateSSHKey struct { DebugKeyPath string } -func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/oneandone/step_take_snapshot.go b/builder/oneandone/step_take_snapshot.go index 65a3f7156..d5c3c757f 100644 --- a/builder/oneandone/step_take_snapshot.go +++ b/builder/oneandone/step_take_snapshot.go @@ -10,7 +10,7 @@ import ( type stepTakeSnapshot struct{} -func (s *stepTakeSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepTakeSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/openstack/step_add_image_members.go b/builder/openstack/step_add_image_members.go index 24691dc2c..286835ba2 100644 --- a/builder/openstack/step_add_image_members.go +++ b/builder/openstack/step_add_image_members.go @@ -11,7 +11,7 @@ import ( type stepAddImageMembers struct{} -func (s *stepAddImageMembers) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAddImageMembers) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { imageId := state.Get("image").(string) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/openstack/step_allocate_ip.go b/builder/openstack/step_allocate_ip.go index 50a5e16ed..a63faa836 100644 --- a/builder/openstack/step_allocate_ip.go +++ b/builder/openstack/step_allocate_ip.go @@ -16,7 +16,7 @@ type StepAllocateIp struct { ReuseIPs bool } -func (s *StepAllocateIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAllocateIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) server := state.Get("server").(*servers.Server) diff --git a/builder/openstack/step_create_volume.go b/builder/openstack/step_create_volume.go index ec1734a06..a1ed7e68a 100644 --- a/builder/openstack/step_create_volume.go +++ b/builder/openstack/step_create_volume.go @@ -18,7 +18,7 @@ type StepCreateVolume struct { doCleanup bool } -func (s *StepCreateVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateVolume) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Proceed only if block storage volume is required. if !s.UseBlockStorageVolume { return multistep.ActionContinue diff --git a/builder/openstack/step_detach_volume.go b/builder/openstack/step_detach_volume.go index 70891862f..fe6d76922 100644 --- a/builder/openstack/step_detach_volume.go +++ b/builder/openstack/step_detach_volume.go @@ -13,7 +13,7 @@ type StepDetachVolume struct { UseBlockStorageVolume bool } -func (s *StepDetachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDetachVolume) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Proceed only if block storage volume is used. if !s.UseBlockStorageVolume { return multistep.ActionContinue diff --git a/builder/openstack/step_get_password.go b/builder/openstack/step_get_password.go index 9459c1a19..0c173fa7a 100644 --- a/builder/openstack/step_get_password.go +++ b/builder/openstack/step_get_password.go @@ -21,7 +21,7 @@ type StepGetPassword struct { Comm *communicator.Config } -func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepGetPassword) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_key_pair.go b/builder/openstack/step_key_pair.go index 33fc7e769..87a6ed011 100644 --- a/builder/openstack/step_key_pair.go +++ b/builder/openstack/step_key_pair.go @@ -25,7 +25,7 @@ type StepKeyPair struct { doCleanup bool } -func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/openstack/step_load_flavor.go b/builder/openstack/step_load_flavor.go index 00318c02a..5d922027e 100644 --- a/builder/openstack/step_load_flavor.go +++ b/builder/openstack/step_load_flavor.go @@ -17,7 +17,7 @@ type StepLoadFlavor struct { Flavor string } -func (s *StepLoadFlavor) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepLoadFlavor) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_run_source_server.go b/builder/openstack/step_run_source_server.go index fc108b098..43382e945 100644 --- a/builder/openstack/step_run_source_server.go +++ b/builder/openstack/step_run_source_server.go @@ -28,7 +28,7 @@ type StepRunSourceServer struct { server *servers.Server } -func (s *StepRunSourceServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRunSourceServer) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) flavor := state.Get("flavor_id").(string) sourceImage := state.Get("source_image").(string) diff --git a/builder/openstack/step_source_image_info.go b/builder/openstack/step_source_image_info.go index e6718f472..3ba373941 100644 --- a/builder/openstack/step_source_image_info.go +++ b/builder/openstack/step_source_image_info.go @@ -18,7 +18,7 @@ type StepSourceImageInfo struct { SourceMostRecent bool } -func (s *StepSourceImageInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSourceImageInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_stop_server.go b/builder/openstack/step_stop_server.go index e3c50141b..9b3deb0ec 100644 --- a/builder/openstack/step_stop_server.go +++ b/builder/openstack/step_stop_server.go @@ -12,7 +12,7 @@ import ( type StepStopServer struct{} -func (s *StepStopServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepStopServer) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) server := state.Get("server").(*servers.Server) diff --git a/builder/openstack/step_update_image_tags.go b/builder/openstack/step_update_image_tags.go index b3c93d5de..31d0c767f 100644 --- a/builder/openstack/step_update_image_tags.go +++ b/builder/openstack/step_update_image_tags.go @@ -12,7 +12,7 @@ import ( type stepUpdateImageTags struct{} -func (s *stepUpdateImageTags) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepUpdateImageTags) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { imageId := state.Get("image").(string) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/openstack/step_update_image_visibility.go b/builder/openstack/step_update_image_visibility.go index 82396c1b9..a3ecaae18 100644 --- a/builder/openstack/step_update_image_visibility.go +++ b/builder/openstack/step_update_image_visibility.go @@ -11,7 +11,7 @@ import ( type stepUpdateImageVisibility struct{} -func (s *stepUpdateImageVisibility) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepUpdateImageVisibility) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { imageId := state.Get("image").(string) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/openstack/step_wait_for_rackconnect.go b/builder/openstack/step_wait_for_rackconnect.go index 279aa3cc5..3816962bf 100644 --- a/builder/openstack/step_wait_for_rackconnect.go +++ b/builder/openstack/step_wait_for_rackconnect.go @@ -14,7 +14,7 @@ type StepWaitForRackConnect struct { Wait bool } -func (s *StepWaitForRackConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForRackConnect) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if !s.Wait { return multistep.ActionContinue } diff --git a/builder/oracle/classic/step_add_keys.go b/builder/oracle/classic/step_add_keys.go index 489448633..c68574d16 100644 --- a/builder/oracle/classic/step_add_keys.go +++ b/builder/oracle/classic/step_add_keys.go @@ -15,7 +15,7 @@ type stepAddKeysToAPI struct { KeyName string } -func (s *stepAddKeysToAPI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAddKeysToAPI) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/oracle/classic/step_attach_volume.go b/builder/oracle/classic/step_attach_volume.go index 1ae9ccf13..ffa525aa6 100644 --- a/builder/oracle/classic/step_attach_volume.go +++ b/builder/oracle/classic/step_attach_volume.go @@ -15,7 +15,7 @@ type stepAttachVolume struct { InstanceInfoKey string } -func (s *stepAttachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAttachVolume) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*compute.Client) ui := state.Get("ui").(packer.Ui) instanceInfo := state.Get(s.InstanceInfoKey).(*compute.InstanceInfo) diff --git a/builder/oracle/classic/step_create_image.go b/builder/oracle/classic/step_create_image.go index de97cf16b..abff43c4d 100644 --- a/builder/oracle/classic/step_create_image.go +++ b/builder/oracle/classic/step_create_image.go @@ -13,7 +13,7 @@ import ( type stepCreateImage struct { } -func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) client := state.Get("client").(*compute.Client) config := state.Get("config").(*Config) diff --git a/builder/oracle/classic/step_create_instance.go b/builder/oracle/classic/step_create_instance.go index 261ff901f..0d685a983 100644 --- a/builder/oracle/classic/step_create_instance.go +++ b/builder/oracle/classic/step_create_instance.go @@ -11,7 +11,7 @@ import ( type stepCreateInstance struct{} -func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) ui.Say("Creating Instance...") diff --git a/builder/oracle/classic/step_create_ip_reservation.go b/builder/oracle/classic/step_create_ip_reservation.go index 610f342ee..e1005657d 100644 --- a/builder/oracle/classic/step_create_ip_reservation.go +++ b/builder/oracle/classic/step_create_ip_reservation.go @@ -12,7 +12,7 @@ import ( type stepCreateIPReservation struct{} -func (s *stepCreateIPReservation) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateIPReservation) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/oracle/classic/step_create_persistent_volume.go b/builder/oracle/classic/step_create_persistent_volume.go index a9f27c613..02438d343 100644 --- a/builder/oracle/classic/step_create_persistent_volume.go +++ b/builder/oracle/classic/step_create_persistent_volume.go @@ -17,7 +17,7 @@ type stepCreatePersistentVolume struct { ImageListEntry int } -func (s *stepCreatePersistentVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreatePersistentVolume) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*compute.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/oracle/classic/step_create_pv_builder.go b/builder/oracle/classic/step_create_pv_builder.go index cfc5e14e8..b1f991f35 100644 --- a/builder/oracle/classic/step_create_pv_builder.go +++ b/builder/oracle/classic/step_create_pv_builder.go @@ -16,7 +16,7 @@ type stepCreatePVBuilder struct { SecurityListKey string } -func (s *stepCreatePVBuilder) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreatePVBuilder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) ui.Say("Creating builder instance...") diff --git a/builder/oracle/classic/step_create_pv_master.go b/builder/oracle/classic/step_create_pv_master.go index 075d9f633..e9f16903f 100644 --- a/builder/oracle/classic/step_create_pv_master.go +++ b/builder/oracle/classic/step_create_pv_master.go @@ -15,7 +15,7 @@ type stepCreatePVMaster struct { SecurityListKey string } -func (s *stepCreatePVMaster) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreatePVMaster) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating master instance...") diff --git a/builder/oracle/classic/step_list_images.go b/builder/oracle/classic/step_list_images.go index 654337b30..0248bae84 100644 --- a/builder/oracle/classic/step_list_images.go +++ b/builder/oracle/classic/step_list_images.go @@ -11,7 +11,7 @@ import ( type stepListImages struct{} -func (s *stepListImages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepListImages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/oracle/classic/step_security.go b/builder/oracle/classic/step_security.go index 0355116d5..f69b6c9b0 100644 --- a/builder/oracle/classic/step_security.go +++ b/builder/oracle/classic/step_security.go @@ -18,7 +18,7 @@ type stepSecurity struct { secRuleName string } -func (s *stepSecurity) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSecurity) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) runID := state.Get("run_id").(string) diff --git a/builder/oracle/classic/step_snapshot.go b/builder/oracle/classic/step_snapshot.go index 11749805b..f11f718e0 100644 --- a/builder/oracle/classic/step_snapshot.go +++ b/builder/oracle/classic/step_snapshot.go @@ -13,7 +13,7 @@ type stepSnapshot struct { cleanupSnap bool } -func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) ui.Say("Creating Snapshot...") diff --git a/builder/oracle/classic/step_terminate_pv_master.go b/builder/oracle/classic/step_terminate_pv_master.go index f894ba883..527d63ba6 100644 --- a/builder/oracle/classic/step_terminate_pv_master.go +++ b/builder/oracle/classic/step_terminate_pv_master.go @@ -12,7 +12,7 @@ import ( type stepTerminatePVMaster struct { } -func (s *stepTerminatePVMaster) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepTerminatePVMaster) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // get variables from state ui := state.Get("ui").(packer.Ui) ui.Say("Deleting master Instance...") diff --git a/builder/oracle/classic/step_upload_image.go b/builder/oracle/classic/step_upload_image.go index e94c82ed6..800235199 100644 --- a/builder/oracle/classic/step_upload_image.go +++ b/builder/oracle/classic/step_upload_image.go @@ -24,7 +24,7 @@ type uploadCmdData struct { SegmentPath string } -func (s *stepUploadImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepUploadImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) diff --git a/builder/oracle/common/step_ssh_key_pair.go b/builder/oracle/common/step_ssh_key_pair.go index 49a0fd01b..187eb28af 100644 --- a/builder/oracle/common/step_ssh_key_pair.go +++ b/builder/oracle/common/step_ssh_key_pair.go @@ -22,7 +22,7 @@ type StepKeyPair struct { DebugKeyPath string } -func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/parallels/common/step_attach_floppy.go b/builder/parallels/common/step_attach_floppy.go index fa9566011..cdedb9922 100644 --- a/builder/parallels/common/step_attach_floppy.go +++ b/builder/parallels/common/step_attach_floppy.go @@ -23,7 +23,7 @@ type StepAttachFloppy struct { // Run adds a virtual FDD device to the VM and attaches the image. // If the image is not specified, then this step will be skipped. -func (s *StepAttachFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAttachFloppy) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Determine if we even have a floppy disk to attach var floppyPath string if floppyPathRaw, ok := state.GetOk("floppy_path"); ok { diff --git a/builder/parallels/common/step_attach_parallels_tools.go b/builder/parallels/common/step_attach_parallels_tools.go index 1c1ea31b4..5745ce4f9 100644 --- a/builder/parallels/common/step_attach_parallels_tools.go +++ b/builder/parallels/common/step_attach_parallels_tools.go @@ -26,7 +26,7 @@ type StepAttachParallelsTools struct { // Run adds a virtual CD-ROM device to the VM and attaches Parallels Tools ISO image. // If ISO image is not specified, then this step will be skipped. -func (s *StepAttachParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAttachParallelsTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_compact_disk.go b/builder/parallels/common/step_compact_disk.go index 85688de51..14c6fa49d 100644 --- a/builder/parallels/common/step_compact_disk.go +++ b/builder/parallels/common/step_compact_disk.go @@ -23,7 +23,7 @@ type StepCompactDisk struct { } // Run runs the compaction of the virtual disk attached to the VM. -func (s *StepCompactDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCompactDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_output_dir.go b/builder/parallels/common/step_output_dir.go index f6f092c4a..c71f61bce 100644 --- a/builder/parallels/common/step_output_dir.go +++ b/builder/parallels/common/step_output_dir.go @@ -22,7 +22,7 @@ type StepOutputDir struct { } // Run sets up the output directory. -func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if _, err := os.Stat(s.Path); err == nil && s.Force { diff --git a/builder/parallels/common/step_prepare_parallels_tools.go b/builder/parallels/common/step_prepare_parallels_tools.go index 5da892782..251018cea 100644 --- a/builder/parallels/common/step_prepare_parallels_tools.go +++ b/builder/parallels/common/step_prepare_parallels_tools.go @@ -22,7 +22,7 @@ type StepPrepareParallelsTools struct { } // Run sets the value of "parallels_tools_path". -func (s *StepPrepareParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPrepareParallelsTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if s.ParallelsToolsMode == ParallelsToolsModeDisable { diff --git a/builder/parallels/common/step_prlctl.go b/builder/parallels/common/step_prlctl.go index 9ae6ec7e9..eac00f916 100644 --- a/builder/parallels/common/step_prlctl.go +++ b/builder/parallels/common/step_prlctl.go @@ -29,7 +29,7 @@ type StepPrlctl struct { } // Run executes `prlctl` commands. -func (s *StepPrlctl) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPrlctl) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_run.go b/builder/parallels/common/step_run.go index d59051a06..d3d60fd1a 100644 --- a/builder/parallels/common/step_run.go +++ b/builder/parallels/common/step_run.go @@ -21,7 +21,7 @@ type StepRun struct { } // Run starts the VM. -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_shutdown.go b/builder/parallels/common/step_shutdown.go index 7f9d3b663..03973f6b3 100644 --- a/builder/parallels/common/step_shutdown.go +++ b/builder/parallels/common/step_shutdown.go @@ -29,7 +29,7 @@ type StepShutdown struct { } // Run shuts down the VM. -func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_upload_parallels_tools.go b/builder/parallels/common/step_upload_parallels_tools.go index 0da0b26e0..85620ff93 100644 --- a/builder/parallels/common/step_upload_parallels_tools.go +++ b/builder/parallels/common/step_upload_parallels_tools.go @@ -38,7 +38,7 @@ type StepUploadParallelsTools struct { } // Run uploads the Parallels Tools ISO to the VM. -func (s *StepUploadParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadParallelsTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_upload_version.go b/builder/parallels/common/step_upload_version.go index 1a1bfcf0c..6731b8c32 100644 --- a/builder/parallels/common/step_upload_version.go +++ b/builder/parallels/common/step_upload_version.go @@ -22,7 +22,7 @@ type StepUploadVersion struct { } // Run uploads a file containing the version of Parallels Desktop. -func (s *StepUploadVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_attach_iso.go b/builder/parallels/iso/step_attach_iso.go index a4cf634a8..509fcbdd2 100644 --- a/builder/parallels/iso/step_attach_iso.go +++ b/builder/parallels/iso/step_attach_iso.go @@ -22,7 +22,7 @@ import ( // attachedIso bool type stepAttachISO struct{} -func (s *stepAttachISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAttachISO) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) isoPath := state.Get("iso_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index 42640f5a8..d7b62fbf2 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -14,7 +14,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_create_vm.go b/builder/parallels/iso/step_create_vm.go index 6ec9049eb..801f83899 100644 --- a/builder/parallels/iso/step_create_vm.go +++ b/builder/parallels/iso/step_create_vm.go @@ -18,7 +18,7 @@ type stepCreateVM struct { vmName string } -func (s *stepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(parallelscommon.Driver) diff --git a/builder/parallels/iso/step_set_boot_order.go b/builder/parallels/iso/step_set_boot_order.go index cfcda6080..3b052407c 100644 --- a/builder/parallels/iso/step_set_boot_order.go +++ b/builder/parallels/iso/step_set_boot_order.go @@ -19,7 +19,7 @@ import ( // Produces: type stepSetBootOrder struct{} -func (s *stepSetBootOrder) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSetBootOrder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/pvm/step_import.go b/builder/parallels/pvm/step_import.go index 0907c6b44..dcbc1cf6e 100644 --- a/builder/parallels/pvm/step_import.go +++ b/builder/parallels/pvm/step_import.go @@ -16,7 +16,7 @@ type StepImport struct { vmName string } -func (s *StepImport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepImport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_create_server.go b/builder/profitbricks/step_create_server.go index 00742762a..3d2e44d70 100644 --- a/builder/profitbricks/step_create_server.go +++ b/builder/profitbricks/step_create_server.go @@ -16,7 +16,7 @@ import ( type stepCreateServer struct{} -func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_create_ssh_key.go b/builder/profitbricks/step_create_ssh_key.go index 68c34af33..8490dffc3 100644 --- a/builder/profitbricks/step_create_ssh_key.go +++ b/builder/profitbricks/step_create_ssh_key.go @@ -16,7 +16,7 @@ type StepCreateSSHKey struct { DebugKeyPath string } -func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_take_snapshot.go b/builder/profitbricks/step_take_snapshot.go index a3bfe2d7d..dfb1ff61a 100644 --- a/builder/profitbricks/step_take_snapshot.go +++ b/builder/profitbricks/step_take_snapshot.go @@ -12,7 +12,7 @@ import ( type stepTakeSnapshot struct{} -func (s *stepTakeSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepTakeSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/qemu/step_convert_disk.go b/builder/qemu/step_convert_disk.go index 299c36e65..8fe2c22b9 100644 --- a/builder/qemu/step_convert_disk.go +++ b/builder/qemu/step_convert_disk.go @@ -17,7 +17,7 @@ import ( // hard drive for the virtual machine. type stepConvertDisk struct{} -func (s *stepConvertDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConvertDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) diskName := state.Get("disk_filename").(string) diff --git a/builder/qemu/step_copy_disk.go b/builder/qemu/step_copy_disk.go index 3f1c33ffb..e18e59657 100644 --- a/builder/qemu/step_copy_disk.go +++ b/builder/qemu/step_copy_disk.go @@ -13,7 +13,7 @@ import ( // hard drive for the virtual machine. type stepCopyDisk struct{} -func (s *stepCopyDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCopyDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) isoPath := state.Get("iso_path").(string) diff --git a/builder/qemu/step_create_disk.go b/builder/qemu/step_create_disk.go index 0a18a3c18..e7a6db046 100644 --- a/builder/qemu/step_create_disk.go +++ b/builder/qemu/step_create_disk.go @@ -13,7 +13,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_prepare_output_dir.go b/builder/qemu/step_prepare_output_dir.go index 8eeebb4e1..09a3087ec 100644 --- a/builder/qemu/step_prepare_output_dir.go +++ b/builder/qemu/step_prepare_output_dir.go @@ -12,7 +12,7 @@ import ( type stepPrepareOutputDir struct{} -func (stepPrepareOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (stepPrepareOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_resize_disk.go b/builder/qemu/step_resize_disk.go index f4f44ec34..d25ffaff4 100644 --- a/builder/qemu/step_resize_disk.go +++ b/builder/qemu/step_resize_disk.go @@ -13,7 +13,7 @@ import ( // hard drive for the virtual machine. type stepResizeDisk struct{} -func (s *stepResizeDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepResizeDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index aea087795..abb64f039 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -28,7 +28,7 @@ type qemuArgsTemplateData struct { SSHHostPort int } -func (s *stepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) @@ -176,9 +176,9 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error ui.Say("Overriding defaults Qemu arguments with QemuArgs...") httpPort := state.Get("http_port").(int) - ctx := config.ctx + ictx := config.ctx if config.Comm.Type != "none" { - ctx.Data = qemuArgsTemplateData{ + ictx.Data = qemuArgsTemplateData{ "10.0.2.2", httpPort, config.HTTPDir, @@ -187,7 +187,7 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error sshHostPort, } } else { - ctx.Data = qemuArgsTemplateData{ + ictx.Data = qemuArgsTemplateData{ HTTPIP: "10.0.2.2", HTTPPort: httpPort, HTTPDir: config.HTTPDir, @@ -195,7 +195,7 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error Name: config.VMName, } } - newQemuArgs, err := processArgs(config.QemuArgs, &ctx) + newQemuArgs, err := processArgs(config.QemuArgs, &ictx) if err != nil { return nil, err } diff --git a/builder/qemu/step_set_iso.go b/builder/qemu/step_set_iso.go index f2a89e10a..c5bfe6e95 100644 --- a/builder/qemu/step_set_iso.go +++ b/builder/qemu/step_set_iso.go @@ -16,7 +16,7 @@ type stepSetISO struct { Url []string } -func (s *stepSetISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSetISO) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) iso_path := "" diff --git a/builder/qemu/step_shutdown.go b/builder/qemu/step_shutdown.go index 9c5f89f6c..da265bb9f 100644 --- a/builder/qemu/step_shutdown.go +++ b/builder/qemu/step_shutdown.go @@ -24,7 +24,7 @@ import ( // type stepShutdown struct{} -func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/scaleway/step_create_image.go b/builder/scaleway/step_create_image.go index 113ebf0fa..41f6eee2d 100644 --- a/builder/scaleway/step_create_image.go +++ b/builder/scaleway/step_create_image.go @@ -12,7 +12,7 @@ import ( type stepImage struct{} -func (s *stepImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepImage) Run(ctx 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 080186a52..9cfee4207 100644 --- a/builder/scaleway/step_create_server.go +++ b/builder/scaleway/step_create_server.go @@ -14,7 +14,7 @@ type stepCreateServer struct { serverID string } -func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(ctx 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 b2d211a9a..308913a7b 100644 --- a/builder/scaleway/step_create_ssh_key.go +++ b/builder/scaleway/step_create_ssh_key.go @@ -21,7 +21,7 @@ type stepCreateSSHKey struct { DebugKeyPath string } -func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/scaleway/step_server_info.go b/builder/scaleway/step_server_info.go index 7ab14658f..34b7db1da 100644 --- a/builder/scaleway/step_server_info.go +++ b/builder/scaleway/step_server_info.go @@ -11,7 +11,7 @@ import ( type stepServerInfo struct{} -func (s *stepServerInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepServerInfo) Run(ctx 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 a8a029259..69bbf3586 100644 --- a/builder/scaleway/step_shutdown.go +++ b/builder/scaleway/step_shutdown.go @@ -11,7 +11,7 @@ import ( type stepShutdown struct{} -func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(ctx 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 c369ad883..705a95806 100644 --- a/builder/scaleway/step_snapshot.go +++ b/builder/scaleway/step_snapshot.go @@ -12,7 +12,7 @@ import ( type stepSnapshot struct{} -func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepSnapshot) Run(ctx 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/tencentcloud/cvm/step_check_source_image.go b/builder/tencentcloud/cvm/step_check_source_image.go index de67d85a2..342373885 100644 --- a/builder/tencentcloud/cvm/step_check_source_image.go +++ b/builder/tencentcloud/cvm/step_check_source_image.go @@ -13,7 +13,7 @@ type stepCheckSourceImage struct { sourceImageId string } -func (s *stepCheckSourceImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCheckSourceImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("cvm_client").(*cvm.Client) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/tencentcloud/cvm/step_config_key_pair.go b/builder/tencentcloud/cvm/step_config_key_pair.go index a4c33472e..9f1569f68 100644 --- a/builder/tencentcloud/cvm/step_config_key_pair.go +++ b/builder/tencentcloud/cvm/step_config_key_pair.go @@ -23,7 +23,7 @@ type stepConfigKeyPair struct { keyID string } -func (s *stepConfigKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.Comm.SSHPrivateKeyFile != "" { diff --git a/builder/tencentcloud/cvm/step_config_security_group.go b/builder/tencentcloud/cvm/step_config_security_group.go index 4dbcfba3a..d3206db68 100644 --- a/builder/tencentcloud/cvm/step_config_security_group.go +++ b/builder/tencentcloud/cvm/step_config_security_group.go @@ -20,7 +20,7 @@ type stepConfigSecurityGroup struct { isCreate bool } -func (s *stepConfigSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigSecurityGroup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { vpcClient := state.Get("vpc_client").(*vpc.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/tencentcloud/cvm/step_config_subnet.go b/builder/tencentcloud/cvm/step_config_subnet.go index f77f1e84d..4be31c3cb 100644 --- a/builder/tencentcloud/cvm/step_config_subnet.go +++ b/builder/tencentcloud/cvm/step_config_subnet.go @@ -20,7 +20,7 @@ type stepConfigSubnet struct { isCreate bool } -func (s *stepConfigSubnet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigSubnet) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { vpcClient := state.Get("vpc_client").(*vpc.Client) ui := state.Get("ui").(packer.Ui) vpcId := state.Get("vpc_id").(string) diff --git a/builder/tencentcloud/cvm/step_config_vpc.go b/builder/tencentcloud/cvm/step_config_vpc.go index 65a9299c6..e34991aec 100644 --- a/builder/tencentcloud/cvm/step_config_vpc.go +++ b/builder/tencentcloud/cvm/step_config_vpc.go @@ -19,7 +19,7 @@ type stepConfigVPC struct { isCreate bool } -func (s *stepConfigVPC) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepConfigVPC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { vpcClient := state.Get("vpc_client").(*vpc.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/tencentcloud/cvm/step_copy_image.go b/builder/tencentcloud/cvm/step_copy_image.go index 97feef048..e71a9f8cd 100644 --- a/builder/tencentcloud/cvm/step_copy_image.go +++ b/builder/tencentcloud/cvm/step_copy_image.go @@ -14,7 +14,7 @@ type stepCopyImage struct { SourceRegion string } -func (s *stepCopyImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCopyImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.DesinationRegions) == 0 || (len(s.DesinationRegions) == 1 && s.DesinationRegions[0] == s.SourceRegion) { return multistep.ActionContinue } diff --git a/builder/tencentcloud/cvm/step_create_image.go b/builder/tencentcloud/cvm/step_create_image.go index 7a8555be0..f4cfa9d4f 100644 --- a/builder/tencentcloud/cvm/step_create_image.go +++ b/builder/tencentcloud/cvm/step_create_image.go @@ -13,7 +13,7 @@ type stepCreateImage struct { imageId string } -func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) client := state.Get("cvm_client").(*cvm.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/tencentcloud/cvm/step_pre_validate.go b/builder/tencentcloud/cvm/step_pre_validate.go index 0a07b45f1..ede5293df 100644 --- a/builder/tencentcloud/cvm/step_pre_validate.go +++ b/builder/tencentcloud/cvm/step_pre_validate.go @@ -12,7 +12,7 @@ type stepPreValidate struct { ForceDelete bool } -func (s *stepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPreValidate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("TencentCloud support images with same name, image_name check is not required.") return multistep.ActionContinue diff --git a/builder/tencentcloud/cvm/step_run_instance.go b/builder/tencentcloud/cvm/step_run_instance.go index 40713e25d..fab521e6d 100644 --- a/builder/tencentcloud/cvm/step_run_instance.go +++ b/builder/tencentcloud/cvm/step_run_instance.go @@ -27,7 +27,7 @@ type stepRunInstance struct { AssociatePublicIpAddress bool } -func (s *stepRunInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("cvm_client").(*cvm.Client) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/tencentcloud/cvm/step_share_image.go b/builder/tencentcloud/cvm/step_share_image.go index 1f4bfd464..ffbe3ab9a 100644 --- a/builder/tencentcloud/cvm/step_share_image.go +++ b/builder/tencentcloud/cvm/step_share_image.go @@ -13,7 +13,7 @@ type stepShareImage struct { ShareAccounts []string } -func (s *stepShareImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepShareImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.ShareAccounts) == 0 { return multistep.ActionContinue } diff --git a/builder/triton/step_create_image_from_machine.go b/builder/triton/step_create_image_from_machine.go index 6a4585109..b7df6a0f6 100644 --- a/builder/triton/step_create_image_from_machine.go +++ b/builder/triton/step_create_image_from_machine.go @@ -14,7 +14,7 @@ import ( // The machine must be in the "stopped" state prior to this step being run. type StepCreateImageFromMachine struct{} -func (s *StepCreateImageFromMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateImageFromMachine) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_create_source_machine.go b/builder/triton/step_create_source_machine.go index d25ab8240..1aad77508 100644 --- a/builder/triton/step_create_source_machine.go +++ b/builder/triton/step_create_source_machine.go @@ -13,7 +13,7 @@ import ( // and waits for it to become available for provisioners. type StepCreateSourceMachine struct{} -func (s *StepCreateSourceMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSourceMachine) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_delete_machine.go b/builder/triton/step_delete_machine.go index 8f9e1bc1f..aacb0d426 100644 --- a/builder/triton/step_delete_machine.go +++ b/builder/triton/step_delete_machine.go @@ -12,7 +12,7 @@ import ( // StepDeleteMachine deletes the machine with the ID specified in state["machine"] type StepDeleteMachine struct{} -func (s *StepDeleteMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteMachine) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_stop_machine.go b/builder/triton/step_stop_machine.go index 73fa3f4d6..2e859dec6 100644 --- a/builder/triton/step_stop_machine.go +++ b/builder/triton/step_stop_machine.go @@ -13,7 +13,7 @@ import ( // for it to reach the stopped state. type StepStopMachine struct{} -func (s *StepStopMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepStopMachine) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_wait_for_stop_to_not_fail.go b/builder/triton/step_wait_for_stop_to_not_fail.go index de0a7cc84..e6c6ced64 100644 --- a/builder/triton/step_wait_for_stop_to_not_fail.go +++ b/builder/triton/step_wait_for_stop_to_not_fail.go @@ -13,7 +13,7 @@ import ( // they are started never actually stop. type StepWaitForStopNotToFail struct{} -func (s *StepWaitForStopNotToFail) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForStopNotToFail) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Waiting 10 seconds to avoid potential SDC bug...") time.Sleep(10 * time.Second) diff --git a/builder/vagrant/step_add_box.go b/builder/vagrant/step_add_box.go index 9c1e23eb6..7fa8db320 100644 --- a/builder/vagrant/step_add_box.go +++ b/builder/vagrant/step_add_box.go @@ -68,7 +68,7 @@ func (s *StepAddBox) generateAddArgs() []string { return addArgs } -func (s *StepAddBox) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAddBox) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(VagrantDriver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vagrant/step_create_vagrantfile.go b/builder/vagrant/step_create_vagrantfile.go index 40ead21dd..fa01d62a8 100644 --- a/builder/vagrant/step_create_vagrantfile.go +++ b/builder/vagrant/step_create_vagrantfile.go @@ -72,7 +72,7 @@ func (s *StepCreateVagrantfile) createVagrantfile() (string, error) { return abspath, nil } -func (s *StepCreateVagrantfile) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateVagrantfile) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) // Skip the initialize step if we're trying to launch from a global ID. diff --git a/builder/vagrant/step_package.go b/builder/vagrant/step_package.go index 8200296b4..a6861cd7c 100644 --- a/builder/vagrant/step_package.go +++ b/builder/vagrant/step_package.go @@ -15,7 +15,7 @@ type StepPackage struct { GlobalID string } -func (s *StepPackage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepPackage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(VagrantDriver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vagrant/step_ssh_config.go b/builder/vagrant/step_ssh_config.go index 68fc13aa3..6fb65ccde 100644 --- a/builder/vagrant/step_ssh_config.go +++ b/builder/vagrant/step_ssh_config.go @@ -26,7 +26,7 @@ type StepSSHConfig struct { GlobalID string } -func (s *StepSSHConfig) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSSHConfig) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(VagrantDriver) config := state.Get("config").(*Config) diff --git a/builder/vagrant/step_up.go b/builder/vagrant/step_up.go index 6f2584c5f..23284f852 100644 --- a/builder/vagrant/step_up.go +++ b/builder/vagrant/step_up.go @@ -14,7 +14,7 @@ type StepUp struct { GlobalID string } -func (s *StepUp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(VagrantDriver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_attach_floppy.go b/builder/virtualbox/common/step_attach_floppy.go index 6dac10349..df32fd6e8 100644 --- a/builder/virtualbox/common/step_attach_floppy.go +++ b/builder/virtualbox/common/step_attach_floppy.go @@ -25,7 +25,7 @@ type StepAttachFloppy struct { floppyPath string } -func (s *StepAttachFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAttachFloppy) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Determine if we even have a floppy disk to attach var floppyPath string if floppyPathRaw, ok := state.GetOk("floppy_path"); ok { diff --git a/builder/virtualbox/common/step_attach_guest_additions.go b/builder/virtualbox/common/step_attach_guest_additions.go index dc3e2a0eb..484b074c2 100644 --- a/builder/virtualbox/common/step_attach_guest_additions.go +++ b/builder/virtualbox/common/step_attach_guest_additions.go @@ -26,7 +26,7 @@ type StepAttachGuestAdditions struct { GuestAdditionsInterface string } -func (s *StepAttachGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepAttachGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_export.go b/builder/virtualbox/common/step_export.go index a0359530d..d3d40d72b 100644 --- a/builder/virtualbox/common/step_export.go +++ b/builder/virtualbox/common/step_export.go @@ -27,7 +27,7 @@ type StepExport struct { SkipExport bool } -func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // If ISO export is configured, ensure this option is propagated to VBoxManage. for _, option := range s.ExportOpts { if option == "--iso" || option == "-I" { diff --git a/builder/virtualbox/common/step_remove_devices.go b/builder/virtualbox/common/step_remove_devices.go index d50afb398..5478a56da 100644 --- a/builder/virtualbox/common/step_remove_devices.go +++ b/builder/virtualbox/common/step_remove_devices.go @@ -24,7 +24,7 @@ type StepRemoveDevices struct { GuestAdditionsInterface string } -func (s *StepRemoveDevices) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRemoveDevices) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_run.go b/builder/virtualbox/common/step_run.go index d3a3fb66b..46a45d001 100644 --- a/builder/virtualbox/common/step_run.go +++ b/builder/virtualbox/common/step_run.go @@ -22,7 +22,7 @@ type StepRun struct { vmName string } -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_shutdown.go b/builder/virtualbox/common/step_shutdown.go index af2539cac..de59717ee 100644 --- a/builder/virtualbox/common/step_shutdown.go +++ b/builder/virtualbox/common/step_shutdown.go @@ -28,7 +28,7 @@ type StepShutdown struct { Delay time.Duration } -func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_ssh_key_pair.go b/builder/virtualbox/common/step_ssh_key_pair.go index 929bc9526..282461f27 100644 --- a/builder/virtualbox/common/step_ssh_key_pair.go +++ b/builder/virtualbox/common/step_ssh_key_pair.go @@ -20,7 +20,7 @@ type StepSshKeyPair struct { Comm *communicator.Config } -func (s *StepSshKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSshKeyPair) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if s.Comm.SSHPassword != "" { return multistep.ActionContinue } diff --git a/builder/virtualbox/common/step_suppress_messages.go b/builder/virtualbox/common/step_suppress_messages.go index 369911bdb..0a9def96c 100644 --- a/builder/virtualbox/common/step_suppress_messages.go +++ b/builder/virtualbox/common/step_suppress_messages.go @@ -13,7 +13,7 @@ import ( // pop-up messages don't exist. type StepSuppressMessages struct{} -func (StepSuppressMessages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (StepSuppressMessages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_upload_guest_additions.go b/builder/virtualbox/common/step_upload_guest_additions.go index c77ef7d22..98f46a982 100644 --- a/builder/virtualbox/common/step_upload_guest_additions.go +++ b/builder/virtualbox/common/step_upload_guest_additions.go @@ -22,7 +22,7 @@ type StepUploadGuestAdditions struct { Ctx interpolate.Context } -func (s *StepUploadGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_upload_version.go b/builder/virtualbox/common/step_upload_version.go index deaf8824d..3d84e00ba 100644 --- a/builder/virtualbox/common/step_upload_version.go +++ b/builder/virtualbox/common/step_upload_version.go @@ -16,7 +16,7 @@ type StepUploadVersion struct { Path string } -func (s *StepUploadVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepUploadVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_vboxmanage.go b/builder/virtualbox/common/step_vboxmanage.go index 948cae884..f6df32a07 100644 --- a/builder/virtualbox/common/step_vboxmanage.go +++ b/builder/virtualbox/common/step_vboxmanage.go @@ -28,7 +28,7 @@ type StepVBoxManage struct { Ctx interpolate.Context } -func (s *StepVBoxManage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepVBoxManage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/iso/step_attach_iso.go b/builder/virtualbox/iso/step_attach_iso.go index 624696482..0c36f8e92 100644 --- a/builder/virtualbox/iso/step_attach_iso.go +++ b/builder/virtualbox/iso/step_attach_iso.go @@ -19,7 +19,7 @@ type stepAttachISO struct { diskPath string } -func (s *stepAttachISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepAttachISO) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) isoPath := state.Get("iso_path").(string) diff --git a/builder/virtualbox/iso/step_create_disk.go b/builder/virtualbox/iso/step_create_disk.go index 7c5b03e4f..6a00ea4fa 100644 --- a/builder/virtualbox/iso/step_create_disk.go +++ b/builder/virtualbox/iso/step_create_disk.go @@ -17,7 +17,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/iso/step_create_vm.go b/builder/virtualbox/iso/step_create_vm.go index 2a903db93..604ce8fea 100644 --- a/builder/virtualbox/iso/step_create_vm.go +++ b/builder/virtualbox/iso/step_create_vm.go @@ -19,7 +19,7 @@ type stepCreateVM struct { vmName string } -func (s *stepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/ovf/step_import.go b/builder/virtualbox/ovf/step_import.go index 5e066d83a..caab759b2 100644 --- a/builder/virtualbox/ovf/step_import.go +++ b/builder/virtualbox/ovf/step_import.go @@ -17,7 +17,7 @@ type StepImport struct { vmName string } -func (s *StepImport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepImport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) vmPath := state.Get("vm_path").(string) diff --git a/builder/vmware/common/step_clean_files.go b/builder/vmware/common/step_clean_files.go index 08d14cf63..a9644d225 100644 --- a/builder/vmware/common/step_clean_files.go +++ b/builder/vmware/common/step_clean_files.go @@ -25,7 +25,7 @@ var KeepFileExtensions = []string{".nvram", ".vmdk", ".vmsd", ".vmx", ".vmxf"} // type StepCleanFiles struct{} -func (StepCleanFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (StepCleanFiles) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { dir := state.Get("dir").(OutputDir) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_clean_vmx.go b/builder/vmware/common/step_clean_vmx.go index 1db8a81ee..e913fa165 100644 --- a/builder/vmware/common/step_clean_vmx.go +++ b/builder/vmware/common/step_clean_vmx.go @@ -24,7 +24,7 @@ type StepCleanVMX struct { VNCEnabled bool } -func (s StepCleanVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s StepCleanVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_compact_disk.go b/builder/vmware/common/step_compact_disk.go index 1fdef293c..957f4a254 100644 --- a/builder/vmware/common/step_compact_disk.go +++ b/builder/vmware/common/step_compact_disk.go @@ -23,7 +23,7 @@ type StepCompactDisk struct { Skip bool } -func (s StepCompactDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s StepCompactDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diskFullPaths := state.Get("disk_full_paths").([]string) diff --git a/builder/vmware/common/step_configure_vmx.go b/builder/vmware/common/step_configure_vmx.go index 702f0e0e6..2e48e0574 100644 --- a/builder/vmware/common/step_configure_vmx.go +++ b/builder/vmware/common/step_configure_vmx.go @@ -26,7 +26,7 @@ type StepConfigureVMX struct { VMName string } -func (s *StepConfigureVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { log.Printf("Configuring VMX...\n") var err error diff --git a/builder/vmware/common/step_export.go b/builder/vmware/common/step_export.go index 57095a5d9..3ce738428 100644 --- a/builder/vmware/common/step_export.go +++ b/builder/vmware/common/step_export.go @@ -56,7 +56,7 @@ func (s *StepExport) generateArgs(c *DriverConfig, displayName string, hidePassw return append(s.OVFToolOptions, args...) } -func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("driverConfig").(*DriverConfig) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_output_dir.go b/builder/vmware/common/step_output_dir.go index 90c71e18a..b7f45c5e1 100644 --- a/builder/vmware/common/step_output_dir.go +++ b/builder/vmware/common/step_output_dir.go @@ -19,7 +19,7 @@ type StepOutputDir struct { success bool } -func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { dir := state.Get("dir").(OutputDir) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_prepare_tools.go b/builder/vmware/common/step_prepare_tools.go index 72f8f1488..7c9f992a3 100644 --- a/builder/vmware/common/step_prepare_tools.go +++ b/builder/vmware/common/step_prepare_tools.go @@ -13,7 +13,7 @@ type StepPrepareTools struct { ToolsUploadFlavor string } -func (c *StepPrepareTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (c *StepPrepareTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if c.RemoteType == "esx5" { diff --git a/builder/vmware/common/step_register.go b/builder/vmware/common/step_register.go index 6866e6703..afc361569 100644 --- a/builder/vmware/common/step_register.go +++ b/builder/vmware/common/step_register.go @@ -16,7 +16,7 @@ type StepRegister struct { SkipExport bool } -func (s *StepRegister) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRegister) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_run.go b/builder/vmware/common/step_run.go index 953d8ea5a..5f03ebca5 100644 --- a/builder/vmware/common/step_run.go +++ b/builder/vmware/common/step_run.go @@ -26,7 +26,7 @@ type StepRun struct { vmxPath string } -func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index bc8490ff3..2929eab89 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -34,7 +34,7 @@ type StepShutdown struct { Testing bool } -func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) dir := state.Get("dir").(OutputDir) driver := state.Get("driver").(Driver) diff --git a/builder/vmware/common/step_suppress_messages.go b/builder/vmware/common/step_suppress_messages.go index 02928123a..30e49fe8a 100644 --- a/builder/vmware/common/step_suppress_messages.go +++ b/builder/vmware/common/step_suppress_messages.go @@ -12,7 +12,7 @@ import ( // This step suppresses any messages that VMware product might show. type StepSuppressMessages struct{} -func (s *StepSuppressMessages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepSuppressMessages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_upload_tools.go b/builder/vmware/common/step_upload_tools.go index eed55ab0b..d76836b10 100644 --- a/builder/vmware/common/step_upload_tools.go +++ b/builder/vmware/common/step_upload_tools.go @@ -21,7 +21,7 @@ type StepUploadTools struct { Ctx interpolate.Context } -func (c *StepUploadTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (c *StepUploadTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if c.ToolsUploadFlavor == "" { diff --git a/builder/vmware/common/step_upload_vmx.go b/builder/vmware/common/step_upload_vmx.go index d0c7b1043..b08c6dcbf 100644 --- a/builder/vmware/common/step_upload_vmx.go +++ b/builder/vmware/common/step_upload_vmx.go @@ -22,7 +22,7 @@ type StepUploadVMX struct { RemoteType string } -func (c *StepUploadVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (c *StepUploadVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_create_disk.go b/builder/vmware/iso/step_create_disk.go index b4ced8cd1..452e794be 100644 --- a/builder/vmware/iso/step_create_disk.go +++ b/builder/vmware/iso/step_create_disk.go @@ -22,7 +22,7 @@ import ( // disk_full_paths ([]string) - The full paths to all created disks type stepCreateDisk struct{} -func (stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index 3e95a13e8..8ce8baf8f 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -75,7 +75,7 @@ type stepCreateVMX struct { } /* regular steps */ -func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) isoPath := state.Get("iso_path").(string) ui := state.Get("ui").(packer.Ui) @@ -109,11 +109,11 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist vmxTemplate = string(rawBytes) } - ctx := config.ctx + ictx := config.ctx if len(config.AdditionalDiskSize) > 0 { for i := range config.AdditionalDiskSize { - ctx.Data = &additionalDiskTemplateData{ + ictx.Data = &additionalDiskTemplateData{ DiskNumber: i + 1, DiskName: config.DiskName, } @@ -140,7 +140,7 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist diskTemplate = string(rawBytes) } - diskContents, err := interpolate.Render(diskTemplate, &ctx) + diskContents, err := interpolate.Render(diskTemplate, &ictx) if err != nil { err := fmt.Errorf("Error preparing VMX template for additional disk: %s", err) state.Put("error", err) @@ -396,10 +396,10 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist } } - ctx.Data = &templateData + ictx.Data = &templateData /// render the .vmx template - vmxContents, err := interpolate.Render(vmxTemplate, &ctx) + vmxContents, err := interpolate.Render(vmxTemplate, &ictx) if err != nil { err := fmt.Errorf("Error processing VMX template: %s", err) state.Put("error", err) diff --git a/builder/vmware/iso/step_remote_upload.go b/builder/vmware/iso/step_remote_upload.go index f034d1fc3..7a1e12c93 100644 --- a/builder/vmware/iso/step_remote_upload.go +++ b/builder/vmware/iso/step_remote_upload.go @@ -18,7 +18,7 @@ type stepRemoteUpload struct { DoCleanup bool } -func (s *stepRemoteUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepRemoteUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/vmx/step_clone_vmx.go b/builder/vmware/vmx/step_clone_vmx.go index d48afdc8f..cb2b4aa2f 100644 --- a/builder/vmware/vmx/step_clone_vmx.go +++ b/builder/vmware/vmx/step_clone_vmx.go @@ -23,7 +23,7 @@ type StepCloneVMX struct { tempDir string } -func (s *StepCloneVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCloneVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { halt := func(err error) multistep.StepAction { state.Put("error", err) return multistep.ActionHalt diff --git a/common/step_cleanup_temp_keys.go b/common/step_cleanup_temp_keys.go index 56ca700aa..a943cdc14 100644 --- a/common/step_cleanup_temp_keys.go +++ b/common/step_cleanup_temp_keys.go @@ -14,7 +14,7 @@ type StepCleanupTempKeys struct { Comm *communicator.Config } -func (s *StepCleanupTempKeys) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCleanupTempKeys) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // This step is mostly cosmetic; Packer deletes the ephemeral keys anyway // so there's no realistic situation where these keys can cause issues. // However, it's nice to clean up after yourself. diff --git a/common/step_create_floppy.go b/common/step_create_floppy.go index a2fa48885..cb2278372 100644 --- a/common/step_create_floppy.go +++ b/common/step_create_floppy.go @@ -27,7 +27,7 @@ type StepCreateFloppy struct { FilesAdded map[string]bool } -func (s *StepCreateFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepCreateFloppy) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.Files) == 0 && len(s.Directories) == 0 { log.Println("No floppy files specified. Floppy disk will not be made.") return multistep.ActionContinue diff --git a/common/step_output_dir.go b/common/step_output_dir.go index fc39d08b2..4f68b80c2 100644 --- a/common/step_output_dir.go +++ b/common/step_output_dir.go @@ -22,7 +22,7 @@ type StepOutputDir struct { cleanup bool } -func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if _, err := os.Stat(s.Path); err == nil { diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 2eb975b99..d2d1789fd 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -30,7 +30,7 @@ type StepConnectSSH struct { SSHPort func(multistep.StateBag) (int, error) } -func (s *StepConnectSSH) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConnectSSH) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var comm packer.Communicator diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index 06e6236f8..f6ed7de46 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -33,7 +33,7 @@ type StepConnectWinRM struct { WinRMPort func(multistep.StateBag) (int, error) } -func (s *StepConnectWinRM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConnectWinRM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var comm packer.Communicator diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 0b4e84f18..5abcc9578 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -105,7 +105,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { +func (s *debugStepPause) Run(ctx context.Context, state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep_test.go b/helper/multistep/multistep_test.go index af5cd3368..592990184 100644 --- a/helper/multistep/multistep_test.go +++ b/helper/multistep/multistep_test.go @@ -26,7 +26,7 @@ type TestStepWaitForever struct { type TestStepInjectCancel struct { } -func (s TestStepAcc) Run(_ context.Context, state StateBag) StepAction { +func (s TestStepAcc) Run(ctx context.Context, state StateBag) StepAction { s.insertData(state, "data") if s.Halt { @@ -66,7 +66,7 @@ func (s TestStepWaitForever) Run(context.Context, StateBag) StepAction { func (s TestStepWaitForever) Cleanup(StateBag) {} -func (s TestStepInjectCancel) Run(_ context.Context, state StateBag) StepAction { +func (s TestStepInjectCancel) Run(ctx context.Context, state StateBag) StepAction { r := state.Get("runner").(*BasicRunner) r.state = stateCancelling return ActionContinue diff --git a/post-processor/vagrant-cloud/step_create_provider.go b/post-processor/vagrant-cloud/step_create_provider.go index e664b8b19..5ce4dddb9 100644 --- a/post-processor/vagrant-cloud/step_create_provider.go +++ b/post-processor/vagrant-cloud/step_create_provider.go @@ -19,7 +19,7 @@ type stepCreateProvider struct { name string // the name of the provider } -func (s *stepCreateProvider) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateProvider) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_create_version.go b/post-processor/vagrant-cloud/step_create_version.go index feb247f0a..d9321a160 100644 --- a/post-processor/vagrant-cloud/step_create_version.go +++ b/post-processor/vagrant-cloud/step_create_version.go @@ -16,7 +16,7 @@ type Version struct { type stepCreateVersion struct { } -func (s *stepCreateVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/post-processor/vagrant-cloud/step_prepare_upload.go b/post-processor/vagrant-cloud/step_prepare_upload.go index bdab16d10..6ea2e3bf8 100644 --- a/post-processor/vagrant-cloud/step_prepare_upload.go +++ b/post-processor/vagrant-cloud/step_prepare_upload.go @@ -15,7 +15,7 @@ type Upload struct { type stepPrepareUpload struct { } -func (s *stepPrepareUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepPrepareUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_release_version.go b/post-processor/vagrant-cloud/step_release_version.go index 94e4b90da..ba3381a66 100644 --- a/post-processor/vagrant-cloud/step_release_version.go +++ b/post-processor/vagrant-cloud/step_release_version.go @@ -12,7 +12,7 @@ import ( type stepReleaseVersion struct { } -func (s *stepReleaseVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepReleaseVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_upload.go b/post-processor/vagrant-cloud/step_upload.go index cce1e9de2..9d8a084f3 100644 --- a/post-processor/vagrant-cloud/step_upload.go +++ b/post-processor/vagrant-cloud/step_upload.go @@ -13,7 +13,7 @@ import ( type stepUpload struct { } -func (s *stepUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) upload := state.Get("upload").(*Upload) diff --git a/post-processor/vagrant-cloud/step_verify_box.go b/post-processor/vagrant-cloud/step_verify_box.go index f1dafc991..6db923270 100644 --- a/post-processor/vagrant-cloud/step_verify_box.go +++ b/post-processor/vagrant-cloud/step_verify_box.go @@ -25,7 +25,7 @@ func (b *Box) HasVersion(version string) (bool, *Version) { type stepVerifyBox struct { } -func (s *stepVerifyBox) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepVerifyBox) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/post-processor/vsphere-template/step_choose_datacenter.go b/post-processor/vsphere-template/step_choose_datacenter.go index 450f2b946..f7ba17803 100644 --- a/post-processor/vsphere-template/step_choose_datacenter.go +++ b/post-processor/vsphere-template/step_choose_datacenter.go @@ -13,7 +13,7 @@ type stepChooseDatacenter struct { Datacenter string } -func (s *stepChooseDatacenter) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepChooseDatacenter) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) finder := find.NewFinder(cli.Client, false) diff --git a/post-processor/vsphere-template/step_create_folder.go b/post-processor/vsphere-template/step_create_folder.go index 49232c2f2..181cca0a7 100644 --- a/post-processor/vsphere-template/step_create_folder.go +++ b/post-processor/vsphere-template/step_create_folder.go @@ -15,7 +15,7 @@ type stepCreateFolder struct { Folder string } -func (s *stepCreateFolder) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateFolder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) dcPath := state.Get("dcPath").(string) diff --git a/post-processor/vsphere-template/step_create_snapshot.go b/post-processor/vsphere-template/step_create_snapshot.go index c7fd73e15..7fd0bdde1 100644 --- a/post-processor/vsphere-template/step_create_snapshot.go +++ b/post-processor/vsphere-template/step_create_snapshot.go @@ -37,7 +37,7 @@ func NewStepCreateSnapshot(artifact packer.Artifact, p *PostProcessor) *stepCrea } } -func (s *stepCreateSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) dcPath := state.Get("dcPath").(string) diff --git a/post-processor/vsphere-template/step_mark_as_template.go b/post-processor/vsphere-template/step_mark_as_template.go index 2cf533d55..fc931402e 100644 --- a/post-processor/vsphere-template/step_mark_as_template.go +++ b/post-processor/vsphere-template/step_mark_as_template.go @@ -36,7 +36,7 @@ func NewStepMarkAsTemplate(artifact packer.Artifact) *stepMarkAsTemplate { } } -func (s *stepMarkAsTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) folder := state.Get("folder").(*object.Folder) diff --git a/provisioner/chef-client/provisioner.go b/provisioner/chef-client/provisioner.go index 24c963a36..5fcc17788 100644 --- a/provisioner/chef-client/provisioner.go +++ b/provisioner/chef-client/provisioner.go @@ -383,8 +383,8 @@ func (p *Provisioner) createConfig( tpl = string(tplBytes) } - ctx := p.config.ctx - ctx.Data = &ConfigTemplate{ + ictx := p.config.ctx + ictx.Data = &ConfigTemplate{ NodeName: nodeName, ServerUrl: serverUrl, ClientKey: clientKey, @@ -397,7 +397,7 @@ func (p *Provisioner) createConfig( TrustedCertsDir: trustedCertsDir, EncryptedDataBagSecretPath: encryptedDataBagSecretPath, } - configString, err := interpolate.Render(tpl, &ctx) + configString, err := interpolate.Render(tpl, &ictx) if err != nil { return "", err } @@ -416,15 +416,15 @@ func (p *Provisioner) createKnifeConfig(ui packer.Ui, comm packer.Communicator, // Read the template tpl := DefaultKnifeTemplate - ctx := p.config.ctx - ctx.Data = &ConfigTemplate{ + ictx := p.config.ctx + ictx.Data = &ConfigTemplate{ NodeName: nodeName, ServerUrl: serverUrl, ClientKey: clientKey, SslVerifyMode: sslVerifyMode, TrustedCertsDir: trustedCertsDir, } - configString, err := interpolate.Render(tpl, &ctx) + configString, err := interpolate.Render(tpl, &ictx) if err != nil { return "", err } diff --git a/template/interpolate/i.go b/template/interpolate/i.go index d42d43d50..a7ab3da8c 100644 --- a/template/interpolate/i.go +++ b/template/interpolate/i.go @@ -53,16 +53,16 @@ type I struct { } // Render renders the interpolation with the given context. -func (i *I) Render(ctx *Context) (string, error) { - tpl, err := i.template(ctx) +func (i *I) Render(ictx *Context) (string, error) { + tpl, err := i.template(ictx) if err != nil { return "", err } var result bytes.Buffer var data interface{} - if ctx != nil { - data = ctx.Data + if ictx != nil { + data = ictx.Data } if err := tpl.Execute(&result, data); err != nil { return "", err