openstack object storage acceptance tests fixes
diff --git a/openstack/objectstorage/v1/accounts/results.go b/openstack/objectstorage/v1/accounts/results.go
index e42577a..ba379eb 100644
--- a/openstack/objectstorage/v1/accounts/results.go
+++ b/openstack/objectstorage/v1/accounts/results.go
@@ -1,7 +1,6 @@
package accounts
import (
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -33,9 +32,3 @@
type UpdateResult struct {
gophercloud.Result
}
-
-// Extract returns the unmodified HTTP headers and any error conditions encountered during the
-// metadata update.
-func (ur UpdateResult) Extract() (http.Header, error) {
- return ur.Header, ur.Err
-}
diff --git a/openstack/objectstorage/v1/containers/results.go b/openstack/objectstorage/v1/containers/results.go
index 780d4ae..c00a4bc 100644
--- a/openstack/objectstorage/v1/containers/results.go
+++ b/openstack/objectstorage/v1/containers/results.go
@@ -2,7 +2,6 @@
import (
"fmt"
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -97,9 +96,13 @@
}
}
+type commonResult struct {
+ gophercloud.Result
+}
+
// GetResult represents the result of a get operation.
type GetResult struct {
- gophercloud.Result
+ commonResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -118,32 +121,23 @@
return metadata, nil
}
-type headerResult struct {
- gophercloud.Result
-}
-
-// Extract pulls the unmodified headers from a Create, Update, or Delete result.
-func (result headerResult) Extract() (http.Header, error) {
- return result.Header, result.Err
-}
-
// CreateResult represents the result of a create operation. To extract the
// the headers from the HTTP response, you can invoke the 'ExtractHeaders'
// method on the result struct.
type CreateResult struct {
- headerResult
+ commonResult
}
// UpdateResult represents the result of an update operation. To extract the
// the headers from the HTTP response, you can invoke the 'ExtractHeaders'
// method on the result struct.
type UpdateResult struct {
- headerResult
+ commonResult
}
// DeleteResult represents the result of a delete operation. To extract the
// the headers from the HTTP response, you can invoke the 'ExtractHeaders'
// method on the result struct.
type DeleteResult struct {
- headerResult
+ commonResult
}
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index e662b69..f85f1ac 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -2,7 +2,6 @@
import (
"fmt"
- "net/http"
"strings"
"github.com/rackspace/gophercloud"
@@ -96,9 +95,13 @@
}
}
+type commonResult struct {
+ gophercloud.Result
+}
+
// DownloadResult is a *http.Response that is returned from a call to the Download function.
type DownloadResult struct {
- gophercloud.Result
+ commonResult
}
// ExtractContent is a function that takes a DownloadResult (of type *http.Response)
@@ -112,7 +115,7 @@
// GetResult is a *http.Response that is returned from a call to the Get function.
type GetResult struct {
- gophercloud.Result
+ commonResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
@@ -131,32 +134,22 @@
return metadata, nil
}
-type headerResult struct {
- gophercloud.Result
-}
-
-// Extract returns the unmodified HTTP response headers from a Create, Update, or Delete call, as
-// well as any errors that occurred during the call.
-func (result headerResult) Extract() (http.Header, error) {
- return result.Header, result.Err
-}
-
// CreateResult represents the result of a create operation.
type CreateResult struct {
- headerResult
+ commonResult
}
// UpdateResult represents the result of an update operation.
type UpdateResult struct {
- headerResult
+ commonResult
}
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- headerResult
+ commonResult
}
// CopyResult represents the result of a copy operation.
type CopyResult struct {
- headerResult
+ commonResult
}