more consistent naming
diff --git a/openstack/blockstorage/v1/apiversions/results.go b/openstack/blockstorage/v1/apiversions/results.go
index 79a89de..f510c6d 100644
--- a/openstack/blockstorage/v1/apiversions/results.go
+++ b/openstack/blockstorage/v1/apiversions/results.go
@@ -26,12 +26,11 @@
// ExtractAPIVersions takes a collection page, extracts all of the elements,
// and returns them a slice of APIVersion structs. It is effectively a cast.
-func ExtractAPIVersions(page pagination.Page) ([]APIVersion, error) {
- r := page.(APIVersionPage)
+func ExtractAPIVersions(r pagination.Page) ([]APIVersion, error) {
var s struct {
Versions []APIVersion `json:"versions"`
}
- err := r.ExtractInto(&s)
+ err := (r.(APIVersionPage)).ExtractInto(&s)
return s.Versions, err
}
diff --git a/openstack/blockstorage/v1/snapshots/results.go b/openstack/blockstorage/v1/snapshots/results.go
index f0f8864..195200d 100644
--- a/openstack/blockstorage/v1/snapshots/results.go
+++ b/openstack/blockstorage/v1/snapshots/results.go
@@ -74,12 +74,11 @@
}
// ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call.
-func ExtractSnapshots(page pagination.Page) ([]Snapshot, error) {
- r := page.(SnapshotPage)
+func ExtractSnapshots(r pagination.Page) ([]Snapshot, error) {
var s struct {
Snapshots []Snapshot `json:"snapshots"`
}
- err := r.ExtractInto(&s)
+ err := (r.(SnapshotPage)).ExtractInto(&s)
return s.Snapshots, err
}
@@ -93,7 +92,6 @@
if r.Err != nil {
return nil, r.Err
}
-
m := r.Body.(map[string]interface{})["metadata"]
return m.(map[string]interface{}), nil
}
diff --git a/openstack/blockstorage/v1/volumes/results.go b/openstack/blockstorage/v1/volumes/results.go
index 6371840..09d1ba6 100644
--- a/openstack/blockstorage/v1/volumes/results.go
+++ b/openstack/blockstorage/v1/volumes/results.go
@@ -74,12 +74,11 @@
}
// ExtractVolumes extracts and returns Volumes. It is used while iterating over a volumes.List call.
-func ExtractVolumes(page pagination.Page) ([]Volume, error) {
- r := page.(VolumePage)
+func ExtractVolumes(r pagination.Page) ([]Volume, error) {
var s struct {
Volumes []Volume `json:"volumes"`
}
- err := r.ExtractInto(&s)
+ err := (r.(VolumePage)).ExtractInto(&s)
return s.Volumes, err
}
diff --git a/openstack/blockstorage/v1/volumetypes/results.go b/openstack/blockstorage/v1/volumetypes/results.go
index 74e193f..2c31238 100644
--- a/openstack/blockstorage/v1/volumetypes/results.go
+++ b/openstack/blockstorage/v1/volumetypes/results.go
@@ -39,12 +39,11 @@
}
// ExtractVolumeTypes extracts and returns Volume Types.
-func ExtractVolumeTypes(page pagination.Page) ([]VolumeType, error) {
- r := page.(VolumeTypePage)
+func ExtractVolumeTypes(r pagination.Page) ([]VolumeType, error) {
var s struct {
VolumeTypes []VolumeType `json:"volume_types"`
}
- err := r.ExtractInto(&s)
+ err := (r.(VolumeTypePage)).ExtractInto(&s)
return s.VolumeTypes, err
}