terraform: return unknown variable value if nil

This commit is contained in:
Mitchell Hashimoto 2014-12-16 18:43:18 -08:00
parent 71918efd96
commit 1429ac6a7f
1 changed files with 3 additions and 5 deletions

View File

@ -1629,15 +1629,13 @@ func (c *walkContext) computeModuleVariable(
// modules reference other modules, and graph ordering should // modules reference other modules, and graph ordering should
// ensure that the module is in the state, so if we reach this // ensure that the module is in the state, so if we reach this
// point otherwise it really is a panic. // point otherwise it really is a panic.
return "", nil return config.UnknownVariableValue, nil
} }
value, ok := mod.Outputs[v.Field] value, ok := mod.Outputs[v.Field]
if !ok { if !ok {
return "", fmt.Errorf( // Same reasons as the comment above.
"Output field '%s' not found for variable '%s'", return config.UnknownVariableValue, nil
v.Field,
v.FullKey())
} }
return value, nil return value, nil