Merge lp:~rvb/gwacl/delete-deployment into lp:gwacl
Proposed by
Raphaël Badin
Status: | Merged |
---|---|
Approved by: | Raphaël Badin |
Approved revision: | 71 |
Merged at revision: | 71 |
Proposed branch: | lp:~rvb/gwacl/delete-deployment |
Merge into: | lp:gwacl |
Diff against target: |
53 lines (+21/-0) 3 files modified
example/live_example_managementapi.go (+4/-0) managementapi.go (+5/-0) managementapi_test.go (+12/-0) |
To merge this branch: | bzr merge lp:~rvb/gwacl/delete-deployment |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella | Approve | ||
Review via email: mp+155946@code.launchpad.net |
Commit message
Add method to delete a deployment.
To post a comment you must log in.
Looks good, but [1] is something we need to address before this
library is ready for production.
[1]
+ URI := "services/ hostedservices/ " + serviceName + "/deployments/" + deploymentName
serviceName and deploymentName ought to be passed through
url.QueryEscape... but then that will cause double escaping if set as
Path on a url.URL instance. Perhaps what needs to be done is to
replace / with %2F, *then* set as the Path. Something like:
uri := url.Parse(base_url)
"services/ hostedservices/ " +
strings. Replace( serviceName, "/", "%2F") +
"/deployments/ " +
strings. Replace( deploymentName, "/", "%2F")) delete( uri.String( ))
uri.Path = (
return api.session.
(Fwiw, I gleaned this from reading url.go alongside §3.3 of RFC 3986.)
This is not a problem unique to this branch, so I don't really expect
you to fix it, but we really ought to before stamping this with a 1.0
version.
Fwiw, a poor-man's fix would be to ensure that we (a) don't allow
forward-slash in user-supplied parts of URLs, and (b) ensure that URLs
are put together using url.URL so that proper escaping takes place.