From 8b25acfab65f2053d64f2ab8384bfa6006df296b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Jul 2013 11:00:18 -0700 Subject: [PATCH] fmt --- builder/virtualbox/step_export.go | 8 ++++---- post-processor/vagrant/aws.go | 2 ++ post-processor/vagrant/util.go | 2 +- provisioner/file/provisioner_test.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/builder/virtualbox/step_export.go b/builder/virtualbox/step_export.go index 52472246a..a37f718f4 100644 --- a/builder/virtualbox/step_export.go +++ b/builder/virtualbox/step_export.go @@ -21,17 +21,17 @@ func (s *stepExport) Run(state map[string]interface{}) multistep.StepAction { ui := state["ui"].(packer.Ui) vmName := state["vmName"].(string) - // Clear out the Packer-created forwarding rule + // Clear out the Packer-created forwarding rule ui.Say(fmt.Sprintf("Deleting forwarded port mapping for SSH (host port %d)", state["sshHostPort"])) command := []string{"modifyvm", vmName, "--natpf1", "delete", "packerssh"} if err := driver.VBoxManage(command...); err != nil { err := fmt.Errorf("Error deleting port forwarding rule: %s", err) - state["error"] = err + state["error"] = err ui.Error(err.Error()) - return multistep.ActionHalt + return multistep.ActionHalt } - // Export the VM to an OVF + // Export the VM to an OVF outputPath := filepath.Join(config.OutputDir, "packer.ovf") command = []string{ diff --git a/post-processor/vagrant/aws.go b/post-processor/vagrant/aws.go index 110954a7e..ae5de6ac9 100644 --- a/post-processor/vagrant/aws.go +++ b/post-processor/vagrant/aws.go @@ -79,12 +79,14 @@ func (p *AWSBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact log.Printf("Using vagrantfile template: %s", p.config.VagrantfileTemplate) f, err := os.Open(p.config.VagrantfileTemplate) if err != nil { + err = fmt.Errorf("error opening vagrantfile template: %s", err) return nil, false, err } defer f.Close() contents, err := ioutil.ReadAll(f) if err != nil { + err = fmt.Errorf("error reading vagrantfile template: %s", err) return nil, false, err } diff --git a/post-processor/vagrant/util.go b/post-processor/vagrant/util.go index cd1c8c351..fa6ee8f25 100644 --- a/post-processor/vagrant/util.go +++ b/post-processor/vagrant/util.go @@ -47,7 +47,7 @@ func DirToBox(dst, dir string) error { // Skip directories if info.IsDir() { - log.Printf("Skiping directory '%s' for box '%s'", path, dst) + log.Printf("Skipping directory '%s' for box '%s'", path, dst) return nil } diff --git a/provisioner/file/provisioner_test.go b/provisioner/file/provisioner_test.go index 6fa1e031a..1cae2395a 100644 --- a/provisioner/file/provisioner_test.go +++ b/provisioner/file/provisioner_test.go @@ -114,7 +114,7 @@ func TestProvisionerProvision_SendsFile(t *testing.T) { } config := map[string]interface{}{ - "source": tf.Name(), + "source": tf.Name(), "destination": "something", }