diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index bb5b4c98c..ceab3e7d5 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -782,11 +782,11 @@ }, { "ImportPath": "github.com/hashicorp/hil", - "Rev": "0640fefa3817883b16b77bf760c4c3a6f2589545" + "Rev": "01dc167cd239b7ccab78a683b866536cd5904719" }, { "ImportPath": "github.com/hashicorp/hil/ast", - "Rev": "0640fefa3817883b16b77bf760c4c3a6f2589545" + "Rev": "01dc167cd239b7ccab78a683b866536cd5904719" }, { "ImportPath": "github.com/hashicorp/logutils", diff --git a/vendor/github.com/hashicorp/hil/convert.go b/vendor/github.com/hashicorp/hil/convert.go index c52e2f305..58fd9892a 100644 --- a/vendor/github.com/hashicorp/hil/convert.go +++ b/vendor/github.com/hashicorp/hil/convert.go @@ -16,23 +16,6 @@ func InterfaceToVariable(input interface{}) (ast.Variable, error) { }, nil } - var sliceVal []interface{} - if err := mapstructure.WeakDecode(input, &sliceVal); err == nil { - elements := make([]ast.Variable, len(sliceVal)) - for i, element := range sliceVal { - varElement, err := InterfaceToVariable(element) - if err != nil { - return ast.Variable{}, err - } - elements[i] = varElement - } - - return ast.Variable{ - Type: ast.TypeList, - Value: elements, - }, nil - } - var mapVal map[string]interface{} if err := mapstructure.WeakDecode(input, &mapVal); err == nil { elements := make(map[string]ast.Variable) @@ -50,5 +33,22 @@ func InterfaceToVariable(input interface{}) (ast.Variable, error) { }, nil } + var sliceVal []interface{} + if err := mapstructure.WeakDecode(input, &sliceVal); err == nil { + elements := make([]ast.Variable, len(sliceVal)) + for i, element := range sliceVal { + varElement, err := InterfaceToVariable(element) + if err != nil { + return ast.Variable{}, err + } + elements[i] = varElement + } + + return ast.Variable{ + Type: ast.TypeList, + Value: elements, + }, nil + } + return ast.Variable{}, fmt.Errorf("value for conversion must be a string, interface{} or map[string]interface: got %T", input) }