From c1fbf46a336781538595fcacc5495bd133b93bc0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 4 Oct 2014 16:33:47 -0700 Subject: [PATCH] command: send the provisioner output to the prompt --- command/hook_ui.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/command/hook_ui.go b/command/hook_ui.go index b86701f5e..80c7fea28 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -164,6 +164,18 @@ func (h *UiHook) PreProvision( return terraform.HookActionContinue, nil } +func (h *UiHook) ProvisionOutput( + n *terraform.InstanceInfo, + provId string, + msg string) { + id := n.HumanId() + var buf bytes.Buffer + buf.WriteString(h.Colorize.Color(fmt.Sprintf( + "[reset]%s (%s): ", id, provId))) + buf.WriteString(msg) + h.ui.Output(buf.String()) +} + func (h *UiHook) PreRefresh( n *terraform.InstanceInfo, s *terraform.InstanceState) (terraform.HookAction, error) {