diff --git a/builder/openstack/image_query_test.go b/builder/openstack/image_query_test.go index c9c9c92e1..1263669cf 100644 --- a/builder/openstack/image_query_test.go +++ b/builder/openstack/image_query_test.go @@ -133,6 +133,6 @@ func TestImageFilterOptionsDecode(t *testing.T) { } err := mapstructure.Decode(input, &opts) if err != nil { - t.Error("Did not successfully generate ImageFilterOptions from %v. Contains %v", input, opts) + t.Errorf("Did not successfully generate ImageFilterOptions from %v. Contains %v", input, opts) } } diff --git a/builder/openstack/run_config.go b/builder/openstack/run_config.go index 0db1110bd..1520369f5 100644 --- a/builder/openstack/run_config.go +++ b/builder/openstack/run_config.go @@ -76,7 +76,7 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error { } } - if c.SourceImage == "" && c.SourceImageName == "" && c.SourceImageFilters.Filters != nil { + if c.SourceImage == "" && c.SourceImageName == "" && c.SourceImageFilters.Filters == nil { errs = append(errs, errors.New("Either a source_image, a source_image_name, or must be specified")) } else if len(c.SourceImage) > 0 && len(c.SourceImageName) > 0 { errs = append(errs, errors.New("Only a source_image or a source_image_name can be specified, not both."))