check the region before do the ami copy to fix [GH-2123]

This commit is contained in:
Henry Huang 2015-06-04 06:16:44 -04:00
parent 3a066d53d3
commit a5c476c6fe
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,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))