Merge lp:~themue/juju-core/012-local-storage into lp:~juju/juju-core/trunk
Proposed by
Frank Mueller
Status: | Merged |
---|---|
Merged at revision: | 923 |
Proposed branch: | lp:~themue/juju-core/012-local-storage |
Merge into: | lp:~juju/juju-core/trunk |
Prerequisite: | lp:~themue/juju-core/011-local-storage-backend |
Diff against target: |
278 lines (+256/-0) 3 files modified
environs/local/export_test.go (+6/-0) environs/local/storage.go (+123/-0) environs/local/storage_test.go (+127/-0) |
To merge this branch: | bzr merge lp:~themue/juju-core/012-local-storage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+149246@code.launchpad.net |
Description of the change
local: add storage
Added environ.Storage implementation using the local
storage backend. The tests so far are a copy from
environs/jujutest to check if the behavior is adequate.
To post a comment you must log in.
Overall LGTM, modulo some trivial suggestions.
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go local/storage. go (right):
File environs/
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode11 local/storage. go:11:
environs/
d
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode14 local/storage. go:14:
environs/
var _ environ.Storage = (*storage)(nil) ?
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode30 local/storage. go:30: // exist, it should return a r/NotFoundError - or even use roger's NotFoundf() ?
environs/
*NotFoundError.
s/*NotFoundErro
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode68 local/storage. go:68: if string(body) == "" {
environs/
len(body) == 0 ?
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode76 local/storage. go:76: // URL returns a URL that can be used to
environs/
access the given storage file.
s/a URL/an URL
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode82 local/storage. go:82: // The length must give the total length
environs/
of the file.
s/must give/must be set to/
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode98 local/storage. go:98: return errors. New(resp. Status)
environs/
Include the StatusCode in the error text?
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage. go#newcode120 local/storage. go:120: return errors. New(resp. Status)
environs/
as above
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage_ test.go local/storage_ test.go (right):
File environs/
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage_ test.go# newcode70 local/storage_ test.go: 70: c.Assert(err, IsNil)
environs/
if it's check*, use c.Check, rather than c.Assert - like you're doing
above. Otherwise, call it assert*
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage_ test.go# newcode83 local/storage_ test.go: 83: for a := attempt.Start(); a.Next(); {
environs/
If you're not retrying (attempt strategy is zeroed out), why do you do
that here?
https:/ /codereview. appspot. com/7346052/ diff/1/ environs/ local/storage_ test.go# newcode121 local/storage_ test.go: 121: c.Check(data, DeepEquals, contents)
environs/
Mixing Assert and Check seems a bit random here, care to explain or
unify these?
https:/ /codereview. appspot. com/7346052/