use QuotaSet consistently; fix unit test
diff --git a/openstack/compute/v2/extensions/quotasets/doc.go b/openstack/compute/v2/extensions/quotasets/doc.go
index 893c105..721024e 100644
--- a/openstack/compute/v2/extensions/quotasets/doc.go
+++ b/openstack/compute/v2/extensions/quotasets/doc.go
@@ -1,3 +1,3 @@
-// Package quotasets provides information and interaction with Quotaset
+// Package quotasets provides information and interaction with QuotaSet
// extension for the OpenStack Compute service.
package quotasets
diff --git a/openstack/compute/v2/extensions/quotasets/fixtures.go b/openstack/compute/v2/extensions/quotasets/fixtures.go
index df836e8..c1bb4ea 100644
--- a/openstack/compute/v2/extensions/quotasets/fixtures.go
+++ b/openstack/compute/v2/extensions/quotasets/fixtures.go
@@ -31,8 +31,8 @@
const FirstTenantID = "555544443333222211110000ffffeeee"
-// FirstQuotaset is the first result in ListOutput.
-var FirstQuota = Quotaset{
+// FirstQuotaSet is the first result in ListOutput.
+var FirstQuotaSet = QuotaSet{
FixedIps: 0,
FloatingIps: 0,
InjectedFileContentBytes: 10240,
diff --git a/openstack/compute/v2/extensions/quotasets/requests.go b/openstack/compute/v2/extensions/quotasets/requests.go
index ecb1ba1..52f0839 100644
--- a/openstack/compute/v2/extensions/quotasets/requests.go
+++ b/openstack/compute/v2/extensions/quotasets/requests.go
@@ -4,7 +4,7 @@
"github.com/rackspace/gophercloud"
)
-// Get returns public data about a previously created Quotaset.
+// Get returns public data about a previously created QuotaSet.
func Get(client *gophercloud.ServiceClient, tenantID string) GetResult {
var res GetResult
_, res.Err = client.Get(getURL(client, tenantID), &res.Body, nil)
diff --git a/openstack/compute/v2/extensions/quotasets/requests_test.go b/openstack/compute/v2/extensions/quotasets/requests_test.go
index 8c2a6c6..5d766fa 100644
--- a/openstack/compute/v2/extensions/quotasets/requests_test.go
+++ b/openstack/compute/v2/extensions/quotasets/requests_test.go
@@ -12,5 +12,5 @@
HandleGetSuccessfully(t)
actual, err := Get(client.ServiceClient(), FirstTenantID).Extract()
th.AssertNoErr(t, err)
- th.CheckDeepEquals(t, &FirstQuotaset, actual)
+ th.CheckDeepEquals(t, &FirstQuotaSet, actual)
}
diff --git a/openstack/compute/v2/extensions/quotasets/results.go b/openstack/compute/v2/extensions/quotasets/results.go
index 9cbfe4f..967441f 100644
--- a/openstack/compute/v2/extensions/quotasets/results.go
+++ b/openstack/compute/v2/extensions/quotasets/results.go
@@ -6,7 +6,7 @@
"github.com/rackspace/gophercloud/pagination"
)
-// Quotaset is a set of operational limits that allow for control of compute usage.
+// QuotaSet is a set of operational limits that allow for control of compute usage.
const sample = `
{
"quota_set" : {
@@ -26,7 +26,7 @@
}
`
-type Quotaset struct {
+type QuotaSet struct {
//ID is tenant associated with this quota_set
ID string `mapstructure:"id"`
//FixedIps is number of fixed ips alloted this quota_set
@@ -55,26 +55,26 @@
Instances int `mapstructure:"instances"`
}
-// QuotasetPage stores a single, only page of Quotaset results from a List call.
-type QuotasetPage struct {
+// QuotaSetPage stores a single, only page of QuotaSet results from a List call.
+type QuotaSetPage struct {
pagination.SinglePageBase
}
-// IsEmpty determines whether or not a QuotasetsetPage is empty.
-func (page QuotasetPage) IsEmpty() (bool, error) {
- ks, err := ExtractQuotasets(page)
+// IsEmpty determines whether or not a QuotaSetsetPage is empty.
+func (page QuotaSetPage) IsEmpty() (bool, error) {
+ ks, err := ExtractQuotaSets(page)
return len(ks) == 0, err
}
-// ExtractQuotasets interprets a page of results as a slice of Quotasets.
-func ExtractQuotasets(page pagination.Page) ([]Quotaset, error) {
+// ExtractQuotaSets interprets a page of results as a slice of QuotaSets.
+func ExtractQuotaSets(page pagination.Page) ([]QuotaSet, error) {
var resp struct {
- Quotasets []Quotaset `mapstructure:"quotas"`
+ QuotaSets []QuotaSet `mapstructure:"quotas"`
}
- err := mapstructure.Decode(page.(QuotasetPage).Body, &resp)
- results := make([]Quotaset, len(resp.Quotasets))
- for i, q := range resp.Quotasets {
+ err := mapstructure.Decode(page.(QuotaSetPage).Body, &resp)
+ results := make([]QuotaSet, len(resp.QuotaSets))
+ for i, q := range resp.QuotaSets {
results[i] = q
}
return results, err
@@ -84,22 +84,22 @@
gophercloud.Result
}
-// Extract is a method that attempts to interpret any Quotaset resource response as a Quotaset struct.
-func (r quotaResult) Extract() (*Quotaset, error) {
+// Extract is a method that attempts to interpret any QuotaSet resource response as a QuotaSet struct.
+func (r quotaResult) Extract() (*QuotaSet, error) {
if r.Err != nil {
return nil, r.Err
}
var res struct {
- Quotaset *Quotaset `json:"quota_set" mapstructure:"quota_set"`
+ QuotaSet *QuotaSet `json:"quota_set" mapstructure:"quota_set"`
}
err := mapstructure.Decode(r.Body, &res)
- return res.Quotaset, err
+ return res.QuotaSet, err
}
// GetResult is the response from a Get operation. Call its Extract method to interpret it
-// as a Quotaset.
+// as a QuotaSet.
type GetResult struct {
quotaResult
}