Permalink
Browse files

Removing ServerID as a parameter from volumeattach

  • Loading branch information...
1 parent 520307e commit ef5123783fd5991abad4c47c0bfa22fa9e8b6b3d @jtopjian jtopjian committed Feb 7, 2015
View
@@ -10,3 +10,4 @@ Contributors
| Ash Wilson | <ash.wilson@rackspace.com>
| Jamie Hannaford | <jamie.hannaford@rackspace.com>
| Don Schenck | don.schenck@rackspace.com>
+| Joe Topjian | <joe@topjian.net>
@@ -116,7 +116,6 @@ func HandleCreateSuccessfully(t *testing.T) {
{
"volumeAttachment": {
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804",
- "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0",
"device": "/dev/vdc"
}
}
@@ -14,7 +14,6 @@ type CreateOptsExt struct {
servers.CreateOptsBuilder
Device string `json:"device"`
VolumeID string `json:"volumeId"`
- ServerID string `json:"serverId"`
}
// ToServerCreateMap adds the volume_id, device, and optionally server_id to
@@ -28,7 +27,6 @@ func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error) {
serverMap := base["server"].(map[string]interface{})
serverMap["device"] = opts.Device
serverMap["volume_id"] = opts.VolumeID
- serverMap["server_id"] = opts.ServerID
return base, nil
}
@@ -53,9 +51,6 @@ type CreateOpts struct {
// VolumeID is the ID of the volume to attach to the instance
VolumeID string
-
- // ServerID is the ID of the server that the volume will be attached to
- ServerID string
}
// ToVolumeAttachmentCreateMap constructs a request body from CreateOpts.
@@ -64,13 +59,8 @@ func (opts CreateOpts) ToVolumeAttachmentCreateMap() (map[string]interface{}, er
return nil, errors.New("Missing field required for volume attachment creation: VolumeID")
}
- if opts.ServerID == "" {
- return nil, errors.New("Missing field required for volume attachment creation: ServerID")
- }
-
volumeAttachment := make(map[string]interface{})
volumeAttachment["volumeId"] = opts.VolumeID
- volumeAttachment["serverId"] = opts.ServerID
if opts.Device != "" {
volumeAttachment["device"] = opts.Device
}
@@ -36,7 +36,6 @@ func TestCreate(t *testing.T) {
actual, err := Create(client.ServiceClient(), serverId, CreateOpts{
Device: "/dev/vdc",
VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804",
- ServerID: serverId,
}).Extract()
th.AssertNoErr(t, err)
th.CheckDeepEquals(t, &CreatedVolumeAttachment, actual)

0 comments on commit ef51237

Please sign in to comment.