Added more volume attachment functionality. #6

Merged
merged 1 commit into from Apr 9, 2015

Conversation

Projects
None yet
4 participants
Contributor

kat-co commented Mar 30, 2015

  • Listing volume attachments is now supported.
  • Detaching volumes is now supported.
+ requestData := goosehttp.RequestData{}
+ url := fmt.Sprintf("%s/%s/%s/%s", apiServers, serverId, apiVolumeAttachments, attachmentId)
+ err := c.client.SendRequest(client.DELETE, "compute", url, &requestData)
+ if errors.IsNotFound(err) {
@wallyworld

wallyworld Mar 31, 2015

Owner

Is this a common problem?

@kat-co

kat-co Apr 2, 2015

Contributor

The endpoint not existing? I don't know how common it is, but it's a definite possibility since this is supported only if the OpenStack instance supports volume extensions.

c.Check(volAttachment.ServerId, gc.Equals, instance.Id)
c.Check(volAttachment.VolumeId, gc.Equals, "volume-id")
+
+ // Test listing volumes.
@wallyworld

wallyworld Mar 31, 2015

Owner

These blocks should be in different tests

@kat-co

kat-co Apr 2, 2015

Contributor

If they were unit tests, I would agree. As integration tests, I think they cover a nice cross-section of the code without duplication of effort.

testservices/novaservice/service_http.go
+ }
+ }
+
+ return fmt.Errorf("no such attachment id: %v", attachId)
@wallyworld

wallyworld Mar 31, 2015

Owner

should this be NotFound?

@kat-co

kat-co Apr 2, 2015

Contributor

Hm... probably. I've changed it.

Added more volume attachment functionality.
- Listing volume attachments is now supported.
- Detaching volumes is now supported.
Contributor

kat-co commented Apr 9, 2015

$$merge$$

Member

jujubot commented Apr 9, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-goose

Member

jujubot commented Apr 9, 2015

Build failed: Merging failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-goose/3

mitechie added a commit that referenced this pull request Apr 9, 2015

Merge pull request #6 from kat-co/more-nova-volume-support
Added more volume attachment functionality.

@mitechie mitechie merged commit a591935 into go-goose:v1 Apr 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment