another servers v2 error type
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index 488829e..4c26a68 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -3,7 +3,6 @@
import (
"encoding/base64"
"encoding/json"
- "errors"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
@@ -772,7 +771,10 @@
// ToMetadatumCreateMap assembles a body for a Create request based on the contents of a MetadataumOpts.
func (opts MetadatumOpts) ToMetadatumCreateMap() (map[string]interface{}, string, error) {
if len(opts) != 1 {
- return nil, "", errors.New("CreateMetadatum operation must have 1 and only 1 key-value pair.")
+ err := gophercloud.ErrInvalidInput{}
+ err.Argument = "servers.MetadatumOpts"
+ err.Info = "Must have 1 and only 1 key-value pair"
+ return nil, "", err
}
metadatum := map[string]interface{}{"meta": opts}
var key string
diff --git a/openstack/compute/v2/servers/results.go b/openstack/compute/v2/servers/results.go
index 4d80667..ff2e795 100644
--- a/openstack/compute/v2/servers/results.go
+++ b/openstack/compute/v2/servers/results.go
@@ -70,7 +70,7 @@
// Get the image id from the header
u, err := url.ParseRequestURI(res.Header.Get("Location"))
if err != nil {
- return "", fmt.Errorf("Failed to parse the image id: %s", err.Error())
+ return "", err
}
imageID := path.Base(u.Path)
if imageID == "." || imageID == "/" {