From 3df164502a146bbc78f748398af7a8427d7ea13d Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 23 Jun 2017 16:11:30 -0700 Subject: [PATCH] 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. --- command/meta.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/meta.go b/command/meta.go index 4463d2077..fb68b0601 100644 --- a/command/meta.go +++ b/command/meta.go @@ -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)