From a4966d9823ae11ec4aad039b7181e05e04a7e9ec Mon Sep 17 00:00:00 2001 From: Marin Salinas Date: Tue, 12 Feb 2019 15:12:19 -0600 Subject: [PATCH] add ExpectedRunDevice constant --- builder/osc/bsu/builder.go | 2 +- builder/osc/bsu/builder_acc_test.go | 2 +- builder/osc/bsusurrogate/builder.go | 2 +- builder/osc/common/step_run_source_vm.go | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builder/osc/bsu/builder.go b/builder/osc/bsu/builder.go index 1a08fdbc1..f0d804d37 100644 --- a/builder/osc/bsu/builder.go +++ b/builder/osc/bsu/builder.go @@ -145,7 +145,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Debug: b.config.PackerDebug, BsuOptimized: b.config.BsuOptimized, EnableT2Unlimited: b.config.EnableT2Unlimited, - ExpectedRootDevice: "ebs", // should it be bsu + ExpectedRootDevice: osccommon.RunSourceVmBSUExpectedRootDevice, IamVmProfile: b.config.IamVmProfile, VmInitiatedShutdownBehavior: b.config.VmInitiatedShutdownBehavior, VmType: b.config.VmType, diff --git a/builder/osc/bsu/builder_acc_test.go b/builder/osc/bsu/builder_acc_test.go index 441820e8d..900c640bf 100644 --- a/builder/osc/bsu/builder_acc_test.go +++ b/builder/osc/bsu/builder_acc_test.go @@ -47,7 +47,7 @@ const testBuilderAccBasic = ` "type": "test", "region": "eu-west-2", "vm_type": "m3.medium", - "source_omi": "omi-76b2a71e", + "source_omi": "ami-76b2a71e", "ssh_username": "ubuntu", "omi_name": "packer-test {{timestamp}}" }] diff --git a/builder/osc/bsusurrogate/builder.go b/builder/osc/bsusurrogate/builder.go index 61b7de20c..1649fcede 100644 --- a/builder/osc/bsusurrogate/builder.go +++ b/builder/osc/bsusurrogate/builder.go @@ -176,7 +176,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Debug: b.config.PackerDebug, BsuOptimized: b.config.BsuOptimized, EnableT2Unlimited: b.config.EnableT2Unlimited, - ExpectedRootDevice: "ebs", // should it be bsu + ExpectedRootDevice: osccommon.RunSourceVmBSUExpectedRootDevice, IamVmProfile: b.config.IamVmProfile, VmInitiatedShutdownBehavior: b.config.VmInitiatedShutdownBehavior, VmType: b.config.VmType, diff --git a/builder/osc/common/step_run_source_vm.go b/builder/osc/common/step_run_source_vm.go index 0251c759e..38e175a0d 100644 --- a/builder/osc/common/step_run_source_vm.go +++ b/builder/osc/common/step_run_source_vm.go @@ -18,6 +18,10 @@ import ( "github.com/hashicorp/packer/template/interpolate" ) +const ( + RunSourceVmBSUExpectedRootDevice = "ebs" +) + type StepRunSourceVm struct { AssociatePublicIpAddress bool BlockDevices BlockDevices