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