Fixing results to use new common result
diff --git a/rackspace/blockstorage/v1/snapshots/delegate.go b/rackspace/blockstorage/v1/snapshots/delegate.go
index 345d2fe..fbde513 100644
--- a/rackspace/blockstorage/v1/snapshots/delegate.go
+++ b/rackspace/blockstorage/v1/snapshots/delegate.go
@@ -126,7 +126,7 @@
_, res.Err = perigee.Request("PUT", updateURL(c, snapshotID), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
ReqBody: &reqBody,
- Results: &res.Resp,
+ Results: &res.Body,
OkCodes: []int{200, 201},
})
diff --git a/rackspace/blockstorage/v1/snapshots/results.go b/rackspace/blockstorage/v1/snapshots/results.go
index 9acf0bb..8f4704c 100644
--- a/rackspace/blockstorage/v1/snapshots/results.go
+++ b/rackspace/blockstorage/v1/snapshots/results.go
@@ -55,7 +55,7 @@
}
type commonResult struct {
- gophercloud.CommonResult
+ gophercloud.Result
}
// CreateResult represents the result of a create operation
@@ -70,10 +70,10 @@
// UpdateResult represents the result of an update operation
type UpdateResult struct {
- gophercloud.CommonResult
+ gophercloud.Result
}
-func commonExtract(resp map[string]interface{}, err error) (*Snapshot, error) {
+func commonExtract(resp interface{}, err error) (*Snapshot, error) {
if err != nil {
return nil, err
}
@@ -89,17 +89,17 @@
// Extract will get the Snapshot object out of the GetResult object.
func (r GetResult) Extract() (*Snapshot, error) {
- return commonExtract(r.Resp, r.Err)
+ return commonExtract(r.Body, r.Err)
}
// Extract will get the Snapshot object out of the CreateResult object.
func (r CreateResult) Extract() (*Snapshot, error) {
- return commonExtract(r.Resp, r.Err)
+ return commonExtract(r.Body, r.Err)
}
// Extract will get the Snapshot object out of the UpdateResult object.
func (r UpdateResult) Extract() (*Snapshot, error) {
- return commonExtract(r.Resp, r.Err)
+ return commonExtract(r.Body, r.Err)
}
// ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call.