builder/amazonebs: Don't worry about the map[string]interface crap

This commit is contained in:
Mitchell Hashimoto 2013-05-09 14:05:15 -07:00
parent c580faa1a5
commit 4c37ce5304
3 changed files with 1 additions and 17 deletions

View File

@ -2,7 +2,6 @@ package amazonebs
import (
"encoding/json"
"errors"
"github.com/mitchellh/packer/packer"
"log"
)
@ -19,12 +18,6 @@ type Builder struct {
}
func (b *Builder) Prepare(raw interface{}) (err error) {
_, ok := raw.(map[string]interface{})
if !ok {
err = errors.New("configuration isn't a valid map")
return
}
jsonBytes, err := json.Marshal(raw)
if err != nil {
return

View File

@ -13,15 +13,6 @@ func TestBuilder_ImplementsBuilder(t *testing.T) {
assert.Implementor(&Builder{}, &actual, "should be a Builder")
}
func TestBuilder_Prepare_NotMap(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)
b := &Builder{}
err := b.Prepare(42)
assert.NotNil(err, "should have an error")
assert.Equal(err.Error(), "configuration isn't a valid map", "config is not a map")
}
func TestBuilder_Prepare_BadType(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)

View File

@ -5,7 +5,7 @@
{
"type": "amazon-ebs",
"region": "us-east-1",
"source": "ami-de0d9eb7"
"source_ami": "ami-de0d9eb7"
}
],