command/plan: output while refreshing since that can take awhile
This commit is contained in:
parent
f085ae65fa
commit
b4b116a018
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in New Issue