Merge pull request #175 from msabramo/osutil.AuthOptions_append_tokens_to_provider
osutil.AuthOptions appends /tokens to provider
diff --git a/README.asciidoc b/README.asciidoc
index 5839a99..b7a7c01 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -29,7 +29,9 @@
=== How can I Contribute?
-After using Gophercloud for a while, you might find that it lacks some useful feature, or that existing behavior seems buggy. We welcome contributions from our users for both missing functionality as well as for bug fixes. We encourage contributors to collaborate with the link:http://gophercloud.io/community.html[Gophercloud community.]
+After using Gophercloud for a while, you might find that it lacks some useful feature, or that existing behavior seems buggy. We welcome contributions
+from our users for both missing functionality as well as for bug fixes. We encourage contributors to collaborate with the
+link:http://gophercloud.io/community.html[Gophercloud community.]
Finally, Gophercloud maintains its own link:http://gophercloud.io[announcements and updates blog.]
Feel free to check back now and again to see what's new.
diff --git a/api_fetch.go b/api_fetch.go
index 5cfa2da..ef058c8 100644
--- a/api_fetch.go
+++ b/api_fetch.go
@@ -1,6 +1,7 @@
package gophercloud
import(
+ "fmt"
"github.com/mitchellh/mapstructure"
)
@@ -33,6 +34,11 @@
case "rackspace":
variantMap = RackspaceApi
+
+ default:
+ var err = fmt.Errorf(
+ "PopulateApi: Unknown variant %# v; legal values: \"openstack\", \"rackspace\"", variant)
+ return Api, err
}
err := mapstructure.Decode(variantMap,&Api)
diff --git a/context.go b/context.go
index a41cc6d..aca869c 100644
--- a/context.go
+++ b/context.go
@@ -3,6 +3,7 @@
import (
"net/http"
"strings"
+ "fmt"
)
// Provider structures exist for each tangible provider of OpenStack service.
@@ -110,7 +111,10 @@
func (c *Context) ServersApi(acc AccessProvider, criteria ApiCriteria) (CloudServersProvider, error) {
url := acc.FirstEndpointUrlByCriteria(criteria)
if url == "" {
- return nil, ErrEndpoint
+ var err = fmt.Errorf(
+ "Missing endpoint, or insufficient privileges to access endpoint; criteria = %# v",
+ criteria)
+ return nil, err
}
gcp := &genericServersProvider{
diff --git a/errors.go b/errors.go
index 1719fd2..726ba7e 100644
--- a/errors.go
+++ b/errors.go
@@ -26,11 +26,6 @@
// this error when attempting to register it against a context.
var ErrConfiguration = fmt.Errorf("Missing or incomplete configuration")
-// ErrEndpoint errors happen when no endpoint with the desired characteristics
-// exists in the service catalog. This can also happen if your tenant lacks
-// adequate permissions to access a given endpoint.
-var ErrEndpoint = fmt.Errorf("Missing endpoint, or insufficient privileges to access endpoint")
-
// ErrError errors happen when you attempt to discover the response code
// responsible for a previous request bombing with an error, but pass in an
// error interface which doesn't belong to the web client.
diff --git a/keypairs.go b/keypairs.go
index 9ab8ea7..8ae8cd3 100644
--- a/keypairs.go
+++ b/keypairs.go
@@ -47,6 +47,7 @@
MoreHeaders: map[string]string{
"X-Auth-Token": gsp.access.AuthToken(),
},
+ OkCodes: []int{200},
})
})
return kp, err