Validate context after input of vars on refresh

Fixes #4013.
This commit is contained in:
James Nugent 2015-11-23 10:33:40 +02:00
parent 890e214c00
commit 50b5e7c1a5
1 changed files with 5 additions and 3 deletions

View File

@ -87,14 +87,16 @@ func (c *RefreshCommand) Run(args []string) int {
c.Ui.Error(err.Error())
return 1
}
if !validateContext(ctx, c.Ui) {
return 1
}
if err := ctx.Input(c.InputMode()); err != nil {
c.Ui.Error(fmt.Sprintf("Error configuring: %s", err))
return 1
}
if !validateContext(ctx, c.Ui) {
return 1
}
newState, err := ctx.Refresh()
if err != nil {
c.Ui.Error(fmt.Sprintf("Error refreshing state: %s", err))