Commit b7dab268 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

fmt

parent 01232316
...@@ -38,8 +38,8 @@ func TestBlockDevice(t *testing.T) { ...@@ -38,8 +38,8 @@ func TestBlockDevice(t *testing.T) {
}, },
{ {
Config: &BlockDevice{ Config: &BlockDevice{
DeviceName: "/dev/sdb", DeviceName: "/dev/sdb",
VolumeSize: 8, VolumeSize: 8,
}, },
Result: &ec2.BlockDeviceMapping{ Result: &ec2.BlockDeviceMapping{
......
...@@ -33,11 +33,11 @@ func (stepConfigureVNC) Run(state multistep.StateBag) multistep.StepAction { ...@@ -33,11 +33,11 @@ func (stepConfigureVNC) Run(state multistep.StateBag) multistep.StepAction {
portRange := int(config.VNCPortMax - config.VNCPortMin) portRange := int(config.VNCPortMax - config.VNCPortMin)
for { for {
if portRange > 0 { if portRange > 0 {
vncPort = uint(rand.Intn(portRange)) + config.VNCPortMin vncPort = uint(rand.Intn(portRange)) + config.VNCPortMin
} else { } else {
vncPort = config.VNCPortMin vncPort = config.VNCPortMin
} }
log.Printf("Trying port: %d", vncPort) log.Printf("Trying port: %d", vncPort)
l, err := net.Listen("tcp", fmt.Sprintf(":%d", vncPort)) l, err := net.Listen("tcp", fmt.Sprintf(":%d", vncPort))
if err == nil { if err == nil {
......
...@@ -36,11 +36,11 @@ func (s StepCompactDisk) Run(state multistep.StateBag) multistep.StepAction { ...@@ -36,11 +36,11 @@ func (s StepCompactDisk) Run(state multistep.StateBag) multistep.StepAction {
state.Put("error", fmt.Errorf("Error compacting disk: %s", err)) state.Put("error", fmt.Errorf("Error compacting disk: %s", err))
return multistep.ActionHalt return multistep.ActionHalt
} }
if state.Get("additional_disk_paths") != nil { if state.Get("additional_disk_paths") != nil {
if moreDisks := state.Get("additional_disk_paths").([]string); len(moreDisks) > 0 { if moreDisks := state.Get("additional_disk_paths").([]string); len(moreDisks) > 0 {
for i, path := range moreDisks { for i, path := range moreDisks {
ui.Say(fmt.Sprintf("Compacting additional disk image %d",i+1)) ui.Say(fmt.Sprintf("Compacting additional disk image %d", i+1))
if err := driver.CompactDisk(path); err != nil { if err := driver.CompactDisk(path); err != nil {
state.Put("error", fmt.Errorf("Error compacting additional disk %d: %s", i+1, err)) state.Put("error", fmt.Errorf("Error compacting additional disk %d: %s", i+1, err))
return multistep.ActionHalt return multistep.ActionHalt
......
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