Bunch of fixes
Change-Id: Ic5cd50226b67cb05d755288529c631c4686bbee6
diff --git a/openstack/compute/v2/hypervisors/results.go b/openstack/compute/v2/hypervisors/results.go
index 5c7041d..46638cb 100644
--- a/openstack/compute/v2/hypervisors/results.go
+++ b/openstack/compute/v2/hypervisors/results.go
@@ -3,6 +3,7 @@
import (
"encoding/json"
"fmt"
+
"gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination"
)
@@ -71,11 +72,10 @@
VCPUsUsed int `json:"vcpus_used"`
}
-type Aggregate struct{
- Name string `json:name`
- Hosts []string `json:hosts`
- ID int `json:id`
-
+type Aggregate struct {
+ Name string `json:name`
+ Hosts []string `json:hosts`
+ ID int `json:id`
}
func (r *Hypervisor) UnmarshalJSON(b []byte) error {
@@ -99,7 +99,7 @@
// Newer versions pass the CPU into around as the correct types, this just needs
// converting and copying into place. Older versions pass CPU info around as a string
// and can simply be unmarshalled by the json parser
- var tmpb []byte;
+ var tmpb []byte
switch t := s.CPUInfo.(type) {
case string:
@@ -154,8 +154,8 @@
}
func (page HypervisorPage) IsEmpty() (bool, error) {
- va, err := ExtractHypervisors(page)
- return len(va) == 0, err
+ va, err := ExtractHypervisors(page)
+ return len(va) == 0, err
}
func ExtractHypervisors(p pagination.Page) ([]Hypervisor, error) {
@@ -170,11 +170,10 @@
var h struct {
Aggregates []Aggregate `json:"aggregates"`
}
- fmt.Printf("AA: %s\n", p)
err := (p.(AggregatePage)).ExtractInto(&h)
return h.Aggregates, err
}
type AggregatePage struct {
- pagination.SinglePageBase
+ pagination.SinglePageBase
}