From 4f5d3face276bcc1325fc3c02df4877f7dc54761 Mon Sep 17 00:00:00 2001 From: Luke Farnell Date: Mon, 15 May 2017 22:51:48 -0400 Subject: [PATCH] remove duplicates --- builder/digitalocean/step_snapshot.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/builder/digitalocean/step_snapshot.go b/builder/digitalocean/step_snapshot.go index 460dc56e5..6ec3e4245 100644 --- a/builder/digitalocean/step_snapshot.go +++ b/builder/digitalocean/step_snapshot.go @@ -63,7 +63,7 @@ func (s *stepSnapshot) Run(state multistep.StateBag) multistep.StepAction { if len(c.SnapshotRegions) > 0 { regionSet := make(map[string]struct{}) regions := make([]string, 0, len(c.SnapshotRegions)) - + regionSet[c.Region] = struct{}{} for _, region := range c.SnapshotRegions { // If we already saw the region, then don't look again if _, ok := regionSet[region]; ok { @@ -76,6 +76,7 @@ func (s *stepSnapshot) Run(state multistep.StateBag) multistep.StepAction { regions = append(regions, region) } c.SnapshotRegions = regions + for transfer := range c.SnapshotRegions { transferRequest := &godo.ActionRequest{ "type": "transfer", @@ -89,13 +90,7 @@ func (s *stepSnapshot) Run(state multistep.StateBag) multistep.StepAction { return multistep.ActionHalt } ui.Say(fmt.Sprintf("Transfering Snapshot ID: %d", imageTransfer.ID)) - } - - ui.Say(fmt.Sprintf("Snapshot region: %d", len(regions))) - // ui.Say(fmt.Sprintf("Snapshot regions: %s", strings.Join(c.SnapshotRegions[:], ","))) - - //client.ImageActions.Transfer(context.TODO(), ) } var imageId int