Skip to content

Commit

Permalink
Add purge=true to DeleteSnapshot and test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
telyn committed Jan 13, 2017
1 parent 9085da4 commit a7f30e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/snapshot_calls.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *bytemarkClient) DeleteSnapshot(vm VirtualMachineName, discLabelOrID str
if err != nil {
return
}
r, err := c.BuildRequest("DELETE", BrainEndpoint, "/accounts/%s/groups/%s/virtual_machines/%s/discs/%s/snapshots/%s", vm.Account, vm.Group, vm.VirtualMachine, discLabelOrID, snapshotLabelOrID)
r, err := c.BuildRequest("DELETE", BrainEndpoint, "/accounts/%s/groups/%s/virtual_machines/%s/discs/%s/snapshots/%s?purge=true", vm.Account, vm.Group, vm.VirtualMachine, discLabelOrID, snapshotLabelOrID)
if err != nil {
return
}
Expand Down
3 changes: 3 additions & 0 deletions lib/snapshot_calls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ func TestDeleteSnapshot(t *testing.T) {
if req.Method != "DELETE" {
t.Fatalf("Wrong method %s", req.Method)
}
if req.URL.Query().Get("purge") != "true" { // TODO(telyn): should really be parsing this with url.Values and checking that "purge" == "true"
t.Errorf("Didn't incude the purge parameter")
}
}),
})
defer servers.Close()
Expand Down

0 comments on commit a7f30e1

Please sign in to comment.