command: don't prompt for state migration if TF_INPUT is set

The "confirm" method was directly checking the meta struct's input field,
but that only represents the -input command line flag, and doesn't
respect the TF_INPUT environment variable.

By calling the Input method instead, we check both.

This fixes #15338.
This commit is contained in:
Martin Atkins 2017-06-23 16:11:30 -07:00
parent dc53528350
commit 3df164502a
1 changed files with 2 additions and 2 deletions

View File

@ -402,8 +402,8 @@ func (m *Meta) uiHook() *UiHook {
// confirm asks a yes/no confirmation.
func (m *Meta) confirm(opts *terraform.InputOpts) (bool, error) {
if !m.input {
return false, errors.New("input disabled")
if !m.Input() {
return false, errors.New("input is disabled")
}
for {
v, err := m.UIInput().Input(opts)