Commit 5db4d7c0 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

fmt

parent 288b9a70
...@@ -115,7 +115,7 @@ func (s *StepMountExtra) CleanupFunc(state multistep.StateBag) error { ...@@ -115,7 +115,7 @@ func (s *StepMountExtra) CleanupFunc(state multistep.StateBag) error {
} }
} }
} }
unmountCommand, err := wrappedCommand(fmt.Sprintf("umount %s", path)) unmountCommand, err := wrappedCommand(fmt.Sprintf("umount %s", path))
if err != nil { if err != nil {
return fmt.Errorf("Error creating unmount command: %s", err) return fmt.Errorf("Error creating unmount command: %s", err)
......
...@@ -68,13 +68,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { ...@@ -68,13 +68,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
// First define all our templatable parameters that are _required_ // First define all our templatable parameters that are _required_
templates := map[string]*string{ templates := map[string]*string{
"cluster": &p.config.Cluster, "cluster": &p.config.Cluster,
"datacenter": &p.config.Datacenter, "datacenter": &p.config.Datacenter,
"diskmode": &p.config.DiskMode, "diskmode": &p.config.DiskMode,
"host": &p.config.Host, "host": &p.config.Host,
"password": &p.config.Password, "password": &p.config.Password,
"username": &p.config.Username, "username": &p.config.Username,
"vm_name": &p.config.VMName, "vm_name": &p.config.VMName,
} }
for key, ptr := range templates { for key, ptr := range templates {
if *ptr == "" { if *ptr == "" {
...@@ -108,11 +108,11 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac ...@@ -108,11 +108,11 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
} }
ovftool_uri := fmt.Sprintf("vi://%s:%s@%s/%s/host/%s", ovftool_uri := fmt.Sprintf("vi://%s:%s@%s/%s/host/%s",
url.QueryEscape(p.config.Username), url.QueryEscape(p.config.Username),
url.QueryEscape(p.config.Password), url.QueryEscape(p.config.Password),
p.config.Host, p.config.Host,
p.config.Datacenter, p.config.Datacenter,
p.config.Cluster) p.config.Cluster)
if p.config.ResourcePool != "" { if p.config.ResourcePool != "" {
ovftool_uri += "/Resources/" + p.config.ResourcePool ovftool_uri += "/Resources/" + p.config.ResourcePool
......
...@@ -113,18 +113,18 @@ func TestProvisionerSudo(t *testing.T) { ...@@ -113,18 +113,18 @@ func TestProvisionerSudo(t *testing.T) {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
withSudo := p.sudo("echo hello") withSudo := p.sudo("echo hello")
if withSudo != "sudo echo hello" { if withSudo != "sudo echo hello" {
t.Fatalf("sudo command not generated correctly") t.Fatalf("sudo command not generated correctly")
} }
config["disable_sudo"] = true config["disable_sudo"] = true
err = p.Prepare(config) err = p.Prepare(config)
if err != nil { if err != nil {
t.Fatalf("err: %s", err) t.Fatalf("err: %s", err)
} }
withoutSudo := p.sudo("echo hello") withoutSudo := p.sudo("echo hello")
if withoutSudo != "echo hello" { if withoutSudo != "echo hello" {
t.Fatalf("sudo-less command not generated correctly") t.Fatalf("sudo-less command not generated correctly")
} }
} }
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