Commit 02ebef90 authored by James Sinclair's avatar James Sinclair

Use an index loop as range loops over copies, not references

Fixes #1637
parent e7f27432
...@@ -60,12 +60,12 @@ func (b *BlockDevices) Prepare(t *packer.ConfigTemplate) []error { ...@@ -60,12 +60,12 @@ func (b *BlockDevices) Prepare(t *packer.ConfigTemplate) []error {
var errs []error var errs []error
for outer, bds := range lists { for outer, bds := range lists {
for i, bd := range bds { for i := 0; i < len(bds); i++ {
templates := map[string]*string{ templates := map[string]*string{
"device_name": &bd.DeviceName, "device_name": &bds[i].DeviceName,
"snapshot_id": &bd.SnapshotId, "snapshot_id": &bds[i].SnapshotId,
"virtual_name": &bd.VirtualName, "virtual_name": &bds[i].VirtualName,
"volume_type": &bd.VolumeType, "volume_type": &bds[i].VolumeType,
} }
errs := make([]error, 0) errs := make([]error, 0)
......
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