From b4b116a0185e3c4a808d017514a4fe59f89cd844 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 12 Jul 2014 17:17:03 -0700 Subject: [PATCH] command/plan: output while refreshing since that can take awhile --- command/hook_ui.go | 6 ++++-- command/plan.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/command/hook_ui.go b/command/hook_ui.go index 434fae020..e642e55ed 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -72,7 +72,7 @@ func (h *UiHook) PreApply( } h.ui.Output(h.Colorize.Color(fmt.Sprintf( - "[bold]%s: %s[reset_bold]\n %s", + "[reset][bold]%s: %s[reset_bold]\n %s", id, operation, strings.TrimSpace(attrBuf.String())))) @@ -89,7 +89,9 @@ func (h *UiHook) PreRefresh( id string, s *terraform.ResourceState) (terraform.HookAction, error) { h.once.Do(h.init) - //h.ui.Output(fmt.Sprintf("%s: Refreshing state (ID: %s)", id, s.ID)) + h.ui.Output(h.Colorize.Color(fmt.Sprintf( + "[reset][bold]%s: Refreshing (ID: %s)", + id, s.ID))) return terraform.HookActionContinue, nil } diff --git a/command/plan.go b/command/plan.go index e91524dec..c6115a923 100644 --- a/command/plan.go +++ b/command/plan.go @@ -92,10 +92,12 @@ func (c *PlanCommand) Run(args []string) int { } if refresh { + c.Ui.Output("Refreshing Terraform state prior to plan...\n") if _, err := ctx.Refresh(); err != nil { c.Ui.Error(fmt.Sprintf("Error refreshing state: %s", err)) return 1 } + c.Ui.Output("") } plan, err := ctx.Plan(&terraform.PlanOpts{Destroy: destroy})