Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
cmd/juju/user: add "logout" command #4909
Conversation
howbazaar
reviewed
Apr 3, 2016
| c.Assert(err, jc.ErrorIsNil) | ||
| c.Assert(coretesting.Stdout(context), gc.Equals, "") | ||
| c.Assert(coretesting.Stderr(context), gc.Equals, ` | ||
| -password: | ||
| +username: password: |
howbazaar
Apr 3, 2016
Owner
Curious as to why "username:" is on the same line as "password:" but not the "type password again:".
Why is this?
axw
Apr 4, 2016
Member
When we read the username, output is echoed to the terminal; so when the user hits enter, a newline is printed. There's no echo for the password, so we print a newline out.
howbazaar
reviewed
Apr 3, 2016
| + case 1: | ||
| + ctx.Infof("Logged out. You are still logged into 1 controller.") | ||
| + default: | ||
| + ctx.Infof("Logged out. You are still logged into %d controllers.", loggedInCount) |
|
Generally LGTM, just one question about the output shown n the tests relating to new lines. |
Sure has. I had the newline after "username: " in the test originally, and then tested it interactively and took it out :) As mentioned, because we echo the username input, there's no need for us to add a newline to the output. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
axw commentedMar 29, 2016
"juju logout" will remove the user credentials
for the specified/current controller. If there
is a password but no macaroon recorded for the
user, then the user must either acquire a macaroon
by changing the password first, or use the --force
flag.
We now disallow a client logging in as multiple
users for a controller simultaneously, and
consequently drop the "juju switch-user" command.
You must first log out before logging in as another
user.