From d8fec2e9e5a45482aa62726a64b38f6e1a807333 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 4 Nov 2020 06:15:43 -0800 Subject: [PATCH] move the hyperv-only powershell dependency into the hyperv subdirectory (#10198) --- builder/hyperv/common/config.go | 4 ++-- builder/hyperv/common/driver_ps_4.go | 4 ++-- {common => builder/hyperv/common}/powershell/hyperv/hyperv.go | 4 ++-- .../hyperv/common}/powershell/hyperv/hyperv_test.go | 0 {common => builder/hyperv/common}/powershell/powershell.go | 0 .../hyperv/common}/powershell/powershell_test.go | 0 {common => builder/hyperv/common}/powershell/scriptbuilder.go | 0 builder/hyperv/vmcx/builder.go | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename {common => builder/hyperv/common}/powershell/hyperv/hyperv.go (99%) rename {common => builder/hyperv/common}/powershell/hyperv/hyperv_test.go (100%) rename {common => builder/hyperv/common}/powershell/powershell.go (100%) rename {common => builder/hyperv/common}/powershell/powershell_test.go (100%) rename {common => builder/hyperv/common}/powershell/scriptbuilder.go (100%) diff --git a/builder/hyperv/common/config.go b/builder/hyperv/common/config.go index 5ccd5d453..84473e2dc 100644 --- a/builder/hyperv/common/config.go +++ b/builder/hyperv/common/config.go @@ -8,9 +8,9 @@ import ( "os" "strings" + powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell" + "github.com/hashicorp/packer/builder/hyperv/common/powershell/hyperv" "github.com/hashicorp/packer/common" - powershell "github.com/hashicorp/packer/common/powershell" - "github.com/hashicorp/packer/common/powershell/hyperv" "github.com/hashicorp/packer/template/interpolate" ) diff --git a/builder/hyperv/common/driver_ps_4.go b/builder/hyperv/common/driver_ps_4.go index 13fa4a4d5..e8e8faf29 100644 --- a/builder/hyperv/common/driver_ps_4.go +++ b/builder/hyperv/common/driver_ps_4.go @@ -8,8 +8,8 @@ import ( "strconv" "strings" - "github.com/hashicorp/packer/common/powershell" - "github.com/hashicorp/packer/common/powershell/hyperv" + "github.com/hashicorp/packer/builder/hyperv/common/powershell" + "github.com/hashicorp/packer/builder/hyperv/common/powershell/hyperv" ) type HypervPS4Driver struct { diff --git a/common/powershell/hyperv/hyperv.go b/builder/hyperv/common/powershell/hyperv/hyperv.go similarity index 99% rename from common/powershell/hyperv/hyperv.go rename to builder/hyperv/common/powershell/hyperv/hyperv.go index 75cf4a82f..1c49343b2 100644 --- a/common/powershell/hyperv/hyperv.go +++ b/builder/hyperv/common/powershell/hyperv/hyperv.go @@ -11,7 +11,7 @@ import ( "strings" "text/template" - "github.com/hashicorp/packer/common/powershell" + "github.com/hashicorp/packer/builder/hyperv/common/powershell" ) type scriptOptions struct { @@ -194,7 +194,7 @@ func SetFirstBootDeviceGen1(vmName string, controllerType string) error { script := ` param([string] $vmName, [string] $controllerType) - $vmBootOrder = Hyper-V\Get-VMBios -VMName $vmName | Select-Object -ExpandProperty StartupOrder | Where-Object { $_ -ne $controllerType } + $vmBootOrder = Hyper-V\Get-VMBios -VMName $vmName | Select-Object -ExpandProperty StartupOrder | Where-Object { $_ -ne $controllerType } Hyper-V\Set-VMBios -VMName $vmName -StartupOrder (@($controllerType) + $vmBootOrder) ` diff --git a/common/powershell/hyperv/hyperv_test.go b/builder/hyperv/common/powershell/hyperv/hyperv_test.go similarity index 100% rename from common/powershell/hyperv/hyperv_test.go rename to builder/hyperv/common/powershell/hyperv/hyperv_test.go diff --git a/common/powershell/powershell.go b/builder/hyperv/common/powershell/powershell.go similarity index 100% rename from common/powershell/powershell.go rename to builder/hyperv/common/powershell/powershell.go diff --git a/common/powershell/powershell_test.go b/builder/hyperv/common/powershell/powershell_test.go similarity index 100% rename from common/powershell/powershell_test.go rename to builder/hyperv/common/powershell/powershell_test.go diff --git a/common/powershell/scriptbuilder.go b/builder/hyperv/common/powershell/scriptbuilder.go similarity index 100% rename from common/powershell/scriptbuilder.go rename to builder/hyperv/common/powershell/scriptbuilder.go diff --git a/builder/hyperv/vmcx/builder.go b/builder/hyperv/vmcx/builder.go index 622917ac4..b2968abf6 100644 --- a/builder/hyperv/vmcx/builder.go +++ b/builder/hyperv/vmcx/builder.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/hcl/v2/hcldec" hypervcommon "github.com/hashicorp/packer/builder/hyperv/common" + powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/common/bootcommand" - powershell "github.com/hashicorp/packer/common/powershell" "github.com/hashicorp/packer/common/shutdowncommand" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config"