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

Issue 58970043: provider/local: fall back to os/user if $USER=""

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by axw
Modified:
10 years, 2 months ago
Reviewers:
dimitern, mp+204173, thumper
Visibility:
Public.

Description

provider/local: fall back to os/user if $USER="" If $USER is unset/empty, then fall back to os/user. If that fails, then return an error. Fixes lp:1274780 https://code.launchpad.net/~axwalk/juju-core/lp1274780-osuser-fallback/+merge/204173 Requires: https://code.launchpad.net/~axwalk/juju-core/local-provider-testability/+merge/204169 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -1 line) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M provider/local/environprovider.go View 1 chunk +9 lines, -1 line 2 comments Download
M provider/local/environprovider_test.go View 2 chunks +50 lines, -0 lines 2 comments Download
M provider/local/export_test.go View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 6
axw
Please take a look.
10 years, 3 months ago (2014-01-31 09:11:57 UTC) #1
dimitern
LGTM with one comment. https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider_test.go File provider/local/environprovider_test.go (right): https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider_test.go#newcode262 provider/local/environprovider_test.go:262: userOSErr: errors.New("oh noes"), You could ...
10 years, 3 months ago (2014-01-31 09:25:07 UTC) #2
axw
https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider_test.go File provider/local/environprovider_test.go (right): https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider_test.go#newcode262 provider/local/environprovider_test.go:262: userOSErr: errors.New("oh noes"), On 2014/01/31 09:25:07, dimitern wrote: > ...
10 years, 3 months ago (2014-01-31 11:36:49 UTC) #3
thumper
https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider.go File provider/local/environprovider.go (right): https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider.go#newcode60 provider/local/environprovider.go:60: username = u.Username should we lowercase this?
10 years, 2 months ago (2014-02-13 21:58:04 UTC) #4
axw
https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider.go File provider/local/environprovider.go (right): https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider.go#newcode60 provider/local/environprovider.go:60: username = u.Username On 2014/02/13 21:58:04, thumper wrote: > ...
10 years, 2 months ago (2014-02-14 01:03:27 UTC) #5
thumper
10 years, 2 months ago (2014-02-14 01:08:52 UTC) #6
On 2014/02/14 01:03:27, axw wrote:
>
https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider.go
> File provider/local/environprovider.go (right):
> 
>
https://codereview.appspot.com/58970043/diff/1/provider/local/environprovider...
> provider/local/environprovider.go:60: username = u.Username
> On 2014/02/13 21:58:04, thumper wrote:
> > should we lowercase this?
> 
> Nope, *nix usernames are case sensitive.

LGTM
Sign in to reply to this message.

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