fix acceptance tests and prevent decoding empty responses
diff --git a/openstack/blockstorage/v2/extensions/volumeactions/requests.go b/openstack/blockstorage/v2/extensions/volumeactions/requests.go
index 515fe68..842a659 100644
--- a/openstack/blockstorage/v2/extensions/volumeactions/requests.go
+++ b/openstack/blockstorage/v2/extensions/volumeactions/requests.go
@@ -62,7 +62,7 @@
return res
}
- _, res.Err = client.Post(attachURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
+ _, res.Err = client.Post(attachURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
OkCodes: []int{202},
})
@@ -76,7 +76,7 @@
v := make(map[string]interface{})
reqBody := map[string]interface{}{"os-detach": v}
- _, res.Err = client.Post(detachURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
+ _, res.Err = client.Post(detachURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
OkCodes: []int{202},
})
@@ -90,7 +90,7 @@
v := make(map[string]interface{})
reqBody := map[string]interface{}{"os-reserve": v}
- _, res.Err = client.Post(reserveURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
+ _, res.Err = client.Post(reserveURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
OkCodes: []int{200, 201, 202},
})
@@ -104,7 +104,7 @@
v := make(map[string]interface{})
reqBody := map[string]interface{}{"os-unreserve": v}
- _, res.Err = client.Post(unreserveURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
+ _, res.Err = client.Post(unreserveURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
OkCodes: []int{200, 201, 202},
})
@@ -193,8 +193,8 @@
reqBody := map[string]interface{}{"os-terminate_connection": connctorMap}
- _, res.Err = client.Post(teminateConnectionURL(client, id), reqBody, &res.Body, &gophercloud.RequestOpts{
- OkCodes: []int{200, 201, 202},
+ _, res.Err = client.Post(teminateConnectionURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
+ OkCodes: []int{202},
})
return res
diff --git a/openstack/blockstorage/v2/extensions/volumeactions/results.go b/openstack/blockstorage/v2/extensions/volumeactions/results.go
index c767307..65778e5 100644
--- a/openstack/blockstorage/v2/extensions/volumeactions/results.go
+++ b/openstack/blockstorage/v2/extensions/volumeactions/results.go
@@ -11,22 +11,22 @@
// AttachResult contains the response body and error from a Get request.
type AttachResult struct {
- commonResult
+ gophercloud.ErrResult
}
// DetachResult contains the response body and error from a Get request.
type DetachResult struct {
- commonResult
+ gophercloud.ErrResult
}
// ReserveResult contains the response body and error from a Get request.
type ReserveResult struct {
- commonResult
+ gophercloud.ErrResult
}
// UnreserveResult contains the response body and error from a Get request.
type UnreserveResult struct {
- commonResult
+ gophercloud.ErrResult
}
// InitializeConnectionResult contains the response body and error from a Get request.
@@ -36,7 +36,7 @@
// TerminateConnectionResult contains the response body and error from a Get request.
type TerminateConnectionResult struct {
- commonResult
+ gophercloud.ErrResult
}
// Extract will get the Volume object out of the commonResult object.
@@ -46,7 +46,6 @@
}
var res map[string]interface{}
-
err := mapstructure.Decode(r.Body, &res)
return res, err