Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Spaces test support #4
Conversation
added some commits
Feb 15, 2016
dimitern
reviewed
Feb 15, 2016
| + server.spaces[server.nextSpace] = newSpace | ||
| + server.spaceNameToID[newSpace.Name] = newSpace.ID | ||
| + | ||
| + server.nextSpace++ |
dimitern
Feb 15, 2016
Contributor
FWIW, this is not goroutine-safe - calling NewSpace() concurrently won't work (same applies to nextSubnet). We should fix all those, but it can wait I guess.
dimitern
reviewed
Feb 15, 2016
| @@ -54,10 +55,11 @@ func spacesHandler(server *TestServer, w http.ResponseWriter, r *http.Request) { | ||
| } | ||
| if r.URL.Path == spacesURL { | ||
| - var spaces []Space | ||
| + var spaces []*Space | ||
| for i := uint(1); i < server.nextSpace; i++ { |
dimitern
Feb 15, 2016
Contributor
This seems surprising - why not for spaceID, space := range server.spaces { .. } ?
voidspace
Feb 15, 2016
Contributor
This preserves numerical order by id rather than dictionary iteration order.
|
LGTM |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-gomaasapi |
added a commit
that referenced
this pull request
Feb 15, 2016
jujubot
merged commit f3be5f3
into
juju:master
Feb 15, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
voidspace commentedFeb 15, 2016
Add a NewSpace method to the test server and test spaces support.