Commit 33f8d295 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazonebs, command/build: use new UI interface

parent 2788d29b
......@@ -26,7 +26,7 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) StepAction {
keyring := &ssh.SimpleKeychain{}
err := keyring.AddPEMKey(privateKey)
if err != nil {
ui.Say("Error setting up SSH config: %s", err.Error())
ui.Say(fmt.Sprintf("Error setting up SSH config: %s", err))
return StepHalt
}
......@@ -58,7 +58,7 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) StepAction {
}
if err != nil {
ui.Error("Error connecting to SSH: %s", err.Error())
ui.Error(fmt.Sprintf("Error connecting to SSH: %s", err))
return StepHalt
}
......
package amazonebs
import (
"fmt"
"github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/packer/packer"
)
......@@ -27,7 +28,7 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) StepAction {
}
// Set the AMI ID in the state
ui.Say("AMI: %s", createResp.ImageId)
ui.Say(fmt.Sprintf("AMI: %s", createResp.ImageId))
amis := make(map[string]string)
amis[config.Region] = createResp.ImageId
state["amis"] = amis
......
......@@ -48,7 +48,7 @@ func (s *stepKeyPair) Cleanup(state map[string]interface{}) {
ui.Say("Deleting temporary keypair...")
_, err := ec2conn.DeleteKeyPair(s.keyName)
if err != nil {
ui.Error(
"Error cleaning up keypair. Please delete the key manually: %s", s.keyName)
ui.Error(fmt.Sprintf(
"Error cleaning up keypair. Please delete the key manually: %s", s.keyName))
}
}
......@@ -20,7 +20,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log.Printf("Reading template: %s", args[0])
tplData, err := ioutil.ReadFile(args[0])
if err != nil {
env.Ui().Error("Failed to read template file: %s", err.Error())
env.Ui().Error(fmt.Sprintf("Failed to read template file: %s", err))
return 1
}
......@@ -28,7 +28,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log.Println("Parsing template...")
tpl, err := packer.ParseTemplate(tplData)
if err != nil {
env.Ui().Error("Failed to parse template: %s", err.Error())
env.Ui().Error(fmt.Sprintf("Failed to parse template: %s", err))
return 1
}
......@@ -46,7 +46,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log.Printf("Creating build: %s", buildName)
build, err := tpl.Build(buildName, components)
if err != nil {
env.Ui().Error("Failed to create build '%s': \n\n%s", buildName, err.Error())
env.Ui().Error(fmt.Sprintf("Failed to create build '%s': \n\n%s", buildName, err))
return 1
}
......@@ -93,7 +93,7 @@ func (Command) Run(env packer.Environment, args []string) int {
// Output all the artifacts
env.Ui().Say("\n==> The build completed! The artifacts created were:")
for name, artifact := range artifacts {
env.Ui().Say("--> %s:", name)
env.Ui().Say(fmt.Sprintf("--> %s:", name))
env.Ui().Say(artifact.String())
}
......
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