https://codereview.appspot.com/102970043/diff/1/state/api/usermanager/client_test.go#newcode42
state/api/usermanager/client_test.go:42: err :=
s.APIState.Call("UserManager", "", "AddUser", userArgs, results)
Maybe add a comment here about why s.APIState.Call("UserManager",...) is
used here instead of s.usermanager.AddUser()? I understand why but had
to think about it for a bit.
https://codereview.appspot.com/102970043/diff/1/state/apiserver/charms_test.go#oldcode39
state/apiserver/charms_test.go:39: password, err :=
utils.RandomPassword()
Play devil's advocate: this change means the user has a fixed password
instead of a random one. Are you sure that doesn't negatively impact any
existing tests? I can't think of why it would but it is a test
functionality change.
LGTM - only minor comments and praise added in-line. The user add tests
look much better.
One thing: can this actually land without schema migration support?
https:/ /codereview. appspot. com/102970043/ diff/1/ cmd/juju/ user_add. go user_add. go (left):
File cmd/juju/
https:/ /codereview. appspot. com/102970043/ diff/1/ cmd/juju/ user_add. go#oldcode44 user_add. go:44: Args: "<username> <password>",
cmd/juju/
Sorry for missing this when I implemented --password
https:/ /codereview. appspot. com/102970043/ diff/1/ cmd/juju/ user_add. go user_add. go (right):
File cmd/juju/
https:/ /codereview. appspot. com/102970043/ diff/1/ cmd/juju/ user_add. go#newcode109 user_add. go:109: return err
cmd/juju/
errors.Trace() here too?
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client. go usermanager/ client. go (left):
File state/api/
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client. go#oldcode37 usermanager/ client. go:37: p := params. EntityPasswords {Changes: EntityPassword{ u}}
state/api/
[]params.
These names were terrible! Glad you've fixed it.
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client. go usermanager/ client. go (right):
File state/api/
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client. go#newcode37 usermanager/ client. go:37: Changes: ModifyUser{ {Username: username, DisplayName: displayName,
state/api/
[]params.
Password: password}},
This is much more readable.
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client_ test.go usermanager/ client_ test.go (right):
File state/api/
https:/ /codereview. appspot. com/102970043/ diff/1/ state/api/ usermanager/ client_ test.go# newcode42 usermanager/ client_ test.go: 42: err := Call("UserManag er", "", "AddUser", userArgs, results) Call("UserManag er",... ) is AddUser( )? I understand why but had
state/api/
s.APIState.
Maybe add a comment here about why s.APIState.
used here instead of s.usermanager.
to think about it for a bit.
https:/ /codereview. appspot. com/102970043/ diff/1/ state/apiserver /charms_ test.go /charms_ test.go (left):
File state/apiserver
https:/ /codereview. appspot. com/102970043/ diff/1/ state/apiserver /charms_ test.go# oldcode39 /charms_ test.go: 39: password, err := sword()
state/apiserver
utils.RandomPas
Play devil's advocate: this change means the user has a fixed password
instead of a random one. Are you sure that doesn't negatively impact any
existing tests? I can't think of why it would but it is a test
functionality change.
https:/ /codereview. appspot. com/102970043/ diff/1/ state/user_ test.go
File state/user_test.go (right):
https:/ /codereview. appspot. com/102970043/ diff/1/ state/user_ test.go# newcode45 test.go: 45: func (s *UserSuite) makeUser(c *gc.C) *state.User
state/user_
{
addSomeUser might be a better name, indicating that a test/throwaway
user is being created. It also hints at the username being used.
https:/ /codereview. appspot. com/102970043/