Commit 9387cc1e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #2175 from henrysher/fix-duplicate-ami

check the region before do the ami copy to fix the duplicate ami [GH-2123]
parents f7e49d92 a5c476c6
......@@ -33,6 +33,12 @@ func (s *StepAMIRegionCopy) Run(state multistep.StateBag) multistep.StepAction {
var wg sync.WaitGroup
errs := new(packer.MultiError)
for _, region := range s.Regions {
if region == ec2conn.Config.Region {
ui.Message(fmt.Sprintf("Avoid copying AMI (%s) to %s", ec2conn.Config.Region, region))
continue
}
wg.Add(1)
ui.Message(fmt.Sprintf("Copying to: %s", region))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment