From 67eaa07cf457d102ecfc3d734dd9037edc2d5cc5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 15 Jun 2013 11:14:44 -0700 Subject: [PATCH] packer: Get rid of "name" in template, wasn't used for anything --- packer/template.go | 3 --- packer/template_test.go | 2 -- 2 files changed, 5 deletions(-) diff --git a/packer/template.go b/packer/template.go index 585764ac4..fbd6ef5fd 100644 --- a/packer/template.go +++ b/packer/template.go @@ -11,7 +11,6 @@ import ( // "interface{}" pointers since we actually don't know what their contents // are until we read the "type" field. type rawTemplate struct { - Name string Builders []map[string]interface{} Hooks map[string][]string Provisioners []map[string]interface{} @@ -21,7 +20,6 @@ type rawTemplate struct { // The Template struct represents a parsed template, parsed into the most // completed form it can be without additional processing by the caller. type Template struct { - Name string Builders map[string]rawBuilderConfig Hooks map[string][]string Provisioners []rawProvisionerConfig @@ -61,7 +59,6 @@ func ParseTemplate(data []byte) (t *Template, err error) { } t = &Template{} - t.Name = rawTpl.Name t.Builders = make(map[string]rawBuilderConfig) t.Hooks = rawTpl.Hooks t.Provisioners = make([]rawProvisionerConfig, len(rawTpl.Provisioners)) diff --git a/packer/template_test.go b/packer/template_test.go index 7b90fb5e2..f2297cfd5 100644 --- a/packer/template_test.go +++ b/packer/template_test.go @@ -11,7 +11,6 @@ func TestParseTemplate_Basic(t *testing.T) { data := ` { - "name": "my-image", "builders": [] } ` @@ -19,7 +18,6 @@ func TestParseTemplate_Basic(t *testing.T) { result, err := ParseTemplate([]byte(data)) assert.Nil(err, "should not error") assert.NotNil(result, "template should not be nil") - assert.Equal(result.Name, "my-image", "name should be correct") assert.Length(result.Builders, 0, "no builders") }