Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(474)

Issue 10987043: Implement Storage and PublicStorage for local.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by thumper
Modified:
10 years, 9 months ago
Reviewers:
mp+173386, mue, dave, wallyworld
Visibility:
Public.

Description

Implement Storage and PublicStorage for local. In the restructuring of the directories, I realized that we should just have a configurable root directory for the environment, and have other directories off that. The local config now just has a root-dir. The namespace takes into consideration the root user, and will look for the SUDO_USER environment variable if set to identify the user calling sudo. I also renamed the storage to "storage" and "sharedStorage" based on email conversations. The directories are no longer created when the config is validated as the config may be being parsed and created when the user isn't root, especially when the default directory is in a restricted area. There are now two tests in the config_local.go file that are only run when run as root. To run these locally I had to make sure that the GOPATH was set: sudo GOPATH=/home/tim/go go test -gocheck.f configRootTest https://code.launchpad.net/~thumper/juju-core/local-provider-storage/+merge/173386 Requires: https://code.launchpad.net/~thumper/juju-core/upstart-services/+merge/173121 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : Implement Storage and PublicStorage for local. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -102 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M environs/local/config.go View 3 chunks +79 lines, -15 lines 3 comments Download
M environs/local/config_test.go View 1 3 chunks +89 lines, -21 lines 2 comments Download
M environs/local/environ.go View 5 chunks +42 lines, -5 lines 0 comments Download
M environs/local/environ_test.go View 1 2 chunks +55 lines, -6 lines 0 comments Download
M environs/local/environprovider.go View 4 chunks +16 lines, -41 lines 2 comments Download
M environs/local/environprovider_test.go View 2 chunks +5 lines, -10 lines 0 comments Download
M environs/local/export_test.go View 1 chunk +36 lines, -4 lines 0 comments Download

Messages

Total messages: 6
thumper
Please take a look.
10 years, 9 months ago (2013-07-07 22:55:30 UTC) #1
wallyworld
LGTM with some more tests as suggested https://codereview.appspot.com/10987043/diff/1/environs/local/config.go File environs/local/config.go (right): https://codereview.appspot.com/10987043/diff/1/environs/local/config.go#newcode93 environs/local/config.go:93: if uidStr ...
10 years, 9 months ago (2013-07-08 02:20:11 UTC) #2
thumper
Please take a look. https://codereview.appspot.com/10987043/diff/1/environs/local/config.go File environs/local/config.go (right): https://codereview.appspot.com/10987043/diff/1/environs/local/config.go#newcode93 environs/local/config.go:93: if uidStr != "" && ...
10 years, 9 months ago (2013-07-08 04:01:01 UTC) #3
dave_cheney.net
LGTM. https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go File environs/local/config.go (right): https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go#newcode33 environs/local/config.go:33: user := os.Getenv("USER") will this fail on win32 ...
10 years, 9 months ago (2013-07-08 07:34:38 UTC) #4
mue
LGTM, only one remark. https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go File environs/local/config.go (right): https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go#newcode33 environs/local/config.go:33: user := os.Getenv("USER") On 2013/07/08 ...
10 years, 9 months ago (2013-07-08 08:50:56 UTC) #5
thumper
10 years, 9 months ago (2013-07-08 22:41:11 UTC) #6
https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go
File environs/local/config.go (right):

https://codereview.appspot.com/10987043/diff/8001/environs/local/config.go#ne...
environs/local/config.go:33: user := os.Getenv("USER")
On 2013/07/08 08:50:56, mue wrote:
> On 2013/07/08 07:34:39, dfc wrote:
> > will this fail on win32 ?
> 
> If I'm right this only runs on server-side, so no win32. Or am I wrong?

It won't fail, but unlikely to ever be usable on anything except linux as it is
using LXC containers.

I'm not sure what windows uses for the user, but for this, it really isn't going
to matter.

https://codereview.appspot.com/10987043/diff/8001/environs/local/config_test.go
File environs/local/config_test.go (right):

https://codereview.appspot.com/10987043/diff/8001/environs/local/config_test....
environs/local/config_test.go:110: if runtime.GOOS != "linux" {
On 2013/07/08 07:34:39, dfc wrote:
> i think this is the first place we've used c.Skip. Maybe this should be done
> above when calling gc.Suite(&configRootSuite{})

It is certainly easier to skip the test as it is being called, rather than at
the registration phase.

https://codereview.appspot.com/10987043/diff/8001/environs/local/environprovi...
File environs/local/environprovider.go (right):

https://codereview.appspot.com/10987043/diff/8001/environs/local/environprovi...
environs/local/environprovider.go:86: # Override the directory that is used for
the storage files and mongo database.
On 2013/07/08 08:50:56, mue wrote:
> s/and mongo database/and database/
> 
> No need to mention the used technology here. We already changed it once and
> fought a long time with the references.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b