Merge lp:~niedbalski/goose/fix-pr-689 into lp:goose

Proposed by Jorge Niedbalski on 2014-10-29
Status: Rejected
Rejected by: Ian Booth on 2014-11-13
Proposed branch: lp:~niedbalski/goose/fix-pr-689
Merge into: lp:goose
Diff against target: 23 lines (+8/-1)
1 file modified
testservices/swiftservice/service_http.go (+8/-1)
To merge this branch: bzr merge lp:~niedbalski/goose/fix-pr-689
Reviewer Review Type Date Requested Status
Andrew Wilkins (community) 2014-10-29 Needs Fixing on 2014-10-30
Review via email: mp+240025@code.launchpad.net

Description of the change

- Justification

This patch is a complementary patch for addressing https://github.com/juju/juju/pull/689 required to run
the swift mock server , just to allow PUT/POST operations on en empty named container.

It is possible for Juju to erroneously send a DELETE HTTP request to the swift account API,
which in older versions of swift (and keystone) will result in the account DB for that user in swift being marked as deleted.

To post a comment you must log in.
Andrew Wilkins (axwalk) wrote :

Please add a test for DELETE with empty container in service_http_test.go.

Andrew Wilkins (axwalk) :
review: Needs Fixing
Ian Booth (wallyworld) wrote :

This work is not necessary as I've implemented a test in juju core slightly differently.

Unmerged revisions

128. By Jorge Niedbalski on 2014-10-29

- Complementary fix for https://github.com/juju/juju/pull/689

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'testservices/swiftservice/service_http.go'
--- testservices/swiftservice/service_http.go 2014-04-30 07:35:19 +0000
+++ testservices/swiftservice/service_http.go 2014-10-29 16:30:14 +0000
@@ -187,11 +187,18 @@
187 w.WriteHeader(http.StatusUnauthorized)187 w.WriteHeader(http.StatusUnauthorized)
188 return188 return
189 }189 }
190
190 path := strings.TrimRight(r.URL.Path, "/")191 path := strings.TrimRight(r.URL.Path, "/")
191 path = strings.Trim(path, "/")192 path = strings.Trim(path, "/")
192 parts := strings.SplitN(path, "/", 4)193 parts := strings.SplitN(path, "/", 4)
193 parts = parts[2:]194 parts = parts[2:]
194 if len(parts) == 1 {195
196 // Older versions of Swift API accepts "" containers to be created
197 // This fix is almost exclusively to support the remove fix
198 // proposed on: https://github.com/juju/juju/pull/689
199 if len(parts) == 0 && (r.Method == "PUT" || r.Method == "POST") {
200 s.handleContainers("", w, r)
201 } else if len(parts) == 1 {
195 container := parts[0]202 container := parts[0]
196 s.handleContainers(container, w, r)203 s.handleContainers(container, w, r)
197 } else if len(parts) == 2 {204 } else if len(parts) == 2 {

Subscribers

People subscribed via source and target branches