objectstorage v1 and orchestration v1 struct tags
diff --git a/openstack/orchestration/v1/stacks/template.go b/openstack/orchestration/v1/stacks/template.go
index c08ac30..4cf5aae 100644
--- a/openstack/orchestration/v1/stacks/template.go
+++ b/openstack/orchestration/v1/stacks/template.go
@@ -2,9 +2,10 @@
import (
"fmt"
- "github.com/gophercloud/gophercloud"
"reflect"
"strings"
+
+ "github.com/gophercloud/gophercloud"
)
// Template is a structure that represents OpenStack Heat templates
@@ -27,12 +28,14 @@
return err
}
}
+ var invalid string
for key := range t.Parsed {
if _, ok := TemplateFormatVersions[key]; ok {
return nil
}
+ invalid = key
}
- return fmt.Errorf("Template format version not found.")
+ return ErrInvalidTemplateFormatVersion{Version: invalid}
}
// GetFileContents recursively parses a template to search for urls. These urls
@@ -114,8 +117,7 @@
case string, bool, float64, nil, int:
return nil
default:
- return fmt.Errorf("%v: Unrecognized type", reflect.TypeOf(te))
-
+ return gophercloud.ErrUnexpectedType{Actual: fmt.Sprintf("%v", reflect.TypeOf(te))}
}
return nil
}