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

Issue 14258043: Make local provider work.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by thumper
Modified:
10 years, 6 months ago
Reviewers:
mp+188754, axw1
Visibility:
Public.

Description

Make local provider work. lp:1231724 shows that if a local provider is bootstrapped, the created directory $(JUJU_HOME)/environments is not readable by the user that started the provider as the bootstrap is done by root, and the files and directories created are owned by root with 0600 permission, which means you can't even run juju status on a bootstrapped local provider. https://code.launchpad.net/~thumper/juju-core/environments-dir-permission/+merge/188754 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Make local provider work. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -83 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M environs/configstore/disk.go View 4 chunks +31 lines, -2 lines 0 comments Download
M environs/configstore/disk_test.go View 1 3 chunks +32 lines, -1 line 0 comments Download
M environs/configstore/interface_test.go View 2 chunks +2 lines, -0 lines 0 comments Download
M provider/local/config.go View 3 chunks +2 lines, -24 lines 0 comments Download
M provider/local/config_test.go View 2 chunks +1 line, -50 lines 0 comments Download
M provider/local/environ.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/local/environprovider_test.go View 2 chunks +0 lines, -2 lines 0 comments Download
M provider/local/export_test.go View 1 chunk +1 line, -2 lines 0 comments Download
M utils/apt_test.go View 1 chunk +5 lines, -1 line 0 comments Download
A utils/sudo.go View 1 1 chunk +32 lines, -0 lines 0 comments Download
A utils/sudo_test.go View 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 4
thumper
Please take a look.
10 years, 6 months ago (2013-10-02 02:32:14 UTC) #1
axw1
https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test.go File environs/configstore/disk_test.go (right): https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test.go#newcode154 environs/configstore/disk_test.go:154: s.PatchEnvironment("SUDO_UID", "1000") I think you may want to use ...
10 years, 6 months ago (2013-10-02 03:25:51 UTC) #2
thumper
Please take a look. https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test.go File environs/configstore/disk_test.go (right): https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test.go#newcode154 environs/configstore/disk_test.go:154: s.PatchEnvironment("SUDO_UID", "1000") On 2013/10/02 03:25:52, ...
10 years, 6 months ago (2013-10-02 04:09:43 UTC) #3
axw1
10 years, 6 months ago (2013-10-02 04:48:59 UTC) #4
On 2013/10/02 04:09:43, thumper wrote:
> Please take a look.
> 
>
https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test.go
> File environs/configstore/disk_test.go (right):
> 
>
https://codereview.appspot.com/14258043/diff/1/environs/configstore/disk_test...
> environs/configstore/disk_test.go:154: s.PatchEnvironment("SUDO_UID", "1000")
> On 2013/10/02 03:25:52, axw1 wrote:
> > I think you may want to use os/user.Current(), or NewDisk will fail due to
> lack
> > of permissions to chown (unless you happen to be running as root).
> 
> Good call.
> 
> https://codereview.appspot.com/14258043/diff/1/utils/sudo.go
> File utils/sudo.go (right):
> 
> https://codereview.appspot.com/14258043/diff/1/utils/sudo.go#newcode16
> utils/sudo.go:16: func SudoCallerIds() (int, int, error) {
> On 2013/10/02 03:25:52, axw1 wrote:
> > I may be alone here, but I think named results are useful for documentation
> > here. My eyes usually drift straight to the signature... YMMV
> 
> OK

LGTM. FWIW, I tend to use named results but not bare returns (in case of var
shadowing).
Sign in to reply to this message.

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