From 04f7afa04c71e4470cb1e6ac92629b7c3c38f837 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Thu, 16 Jun 2016 16:05:34 -0500 Subject: [PATCH 1/2] vendor: Update hashicorp/hcl to latest version Catches https://github.com/hashicorp/hcl/pull/132 Fixes #5550 --- .../hashicorp/hcl/hcl/strconv/quote.go | 9 ++-- vendor/vendor.json | 46 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go index 6cfd8c3a5..74e232e15 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go +++ b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go @@ -49,8 +49,7 @@ func Unquote(s string) (t string, err error) { for len(s) > 0 { // If we're starting a '${}' then let it through un-unquoted. // Specifically: we don't unquote any characters within the `${}` - // section, except for escaped quotes and escaped backslashes, which we - // handle specifically. + // section, except for escaped backslashes, which we handle specifically. if s[0] == '$' && len(s) > 1 && s[1] == '{' { buf = append(buf, '$', '{') s = s[2:] @@ -65,12 +64,12 @@ func Unquote(s string) (t string, err error) { s = s[size:] - // We special case escaped double quotes and escaped backslashes in - // interpolations, converting them to their unescaped equivalents. + // We special case escaped backslashes in interpolations, converting + // them to their unescaped equivalents. if r == '\\' { q, _ := utf8.DecodeRuneInString(s) switch q { - case '"', '\\': + case '\\': continue } } diff --git a/vendor/vendor.json b/vendor/vendor.json index ddad231da..3d18f47dc 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -772,68 +772,68 @@ { "checksumSHA1": "5LrCq/ydlbL6pq1cdmuxiw7QV98=", "path": "github.com/hashicorp/hcl", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "WP5ODRo9+USuAsKYPu5RW3q8Epg=", "path": "github.com/hashicorp/hcl/hcl/ast", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "z03dif8bqgQ3Zk/1RGbvfgBXMXo=", "path": "github.com/hashicorp/hcl/hcl/fmtcmd", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "SVw0qm83Anf5T2GkYabn+f7Ibv0=", "path": "github.com/hashicorp/hcl/hcl/parser", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "CSmwxPOTz7GSpnWPF9aGkbVeR64=", "path": "github.com/hashicorp/hcl/hcl/printer", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "WZM0q7Sya8PcGj607x1npgcEPa4=", "path": "github.com/hashicorp/hcl/hcl/scanner", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { - "checksumSHA1": "ETy6J7OZ7zjBNq0V0Lm8E/7Xafw=", + "checksumSHA1": "riN5acfVDm4j6LhWXauqiWH5n84=", "path": "github.com/hashicorp/hcl/hcl/strconv", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "VGNVyGYDGTTCTRqGH5R+CL0u6xw=", "path": "github.com/hashicorp/hcl/hcl/token", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "uEaK2zagnGctsUmjWt8ZYmK1Yvs=", "path": "github.com/hashicorp/hcl/json/parser", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "S1e0F9ZKSnqgOLfjDTYazRL28tA=", "path": "github.com/hashicorp/hcl/json/scanner", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "fNlXQCQEnb+B3k5UDL/r15xtSJY=", "path": "github.com/hashicorp/hcl/json/token", - "revision": "d7400db7143f8e869812e50a53acd6c8d92af3b8", - "revisionTime": "2016-06-07T00:19:40Z" + "revision": "aa7699b7b62c5f410f4cf7b58f3f9b17a71fb4ad", + "revisionTime": "2016-06-16T21:00:17Z" }, { "checksumSHA1": "vWW3HXm7OTOMISuZPcCSJODRYkU=", From 9d6c629689e535061250bbc29cfb46d97a2a2cb0 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Mon, 20 Jun 2016 19:06:03 +0300 Subject: [PATCH 2/2] config: Update test to reflect new behaviour Escaped quotes are no longer supported as HIL syntax (as of the last update to HIL), so this commit changes the Terraform config-layer test to verify the non-presence of this behaviour for 0.7. --- config/loader_test.go | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/config/loader_test.go b/config/loader_test.go index 09f63e231..b7d53dee5 100644 --- a/config/loader_test.go +++ b/config/loader_test.go @@ -132,22 +132,13 @@ func TestLoadFileHeredoc(t *testing.T) { } func TestLoadFileEscapedQuotes(t *testing.T) { - c, err := LoadFile(filepath.Join(fixtureDir, "escapedquotes.tf")) - if err != nil { - t.Fatalf("err: %s", err) + _, err := LoadFile(filepath.Join(fixtureDir, "escapedquotes.tf")) + if err == nil { + t.Fatalf("expected syntax error as escaped quotes are no longer supported") } - if c == nil { - t.Fatal("config should not be nil") - } - - if c.Dir != "" { - t.Fatalf("bad: %#v", c.Dir) - } - - actual := resourcesStr(c.Resources) - if actual != strings.TrimSpace(escapedquotesResourcesStr) { - t.Fatalf("bad:\n%s", actual) + if !strings.Contains(err.Error(), "syntax error") { + t.Fatalf("expected \"syntax error\", got: %s", err) } } @@ -787,13 +778,6 @@ aws_instance.test (x1) inline ` -const escapedquotesResourcesStr = ` -aws_instance.quotes (x1) - ami - vars - user: var.ami -` - const basicOutputsStr = ` web_ip vars