~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/user/info.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package user
5
5
 
6
6
import (
7
 
        "time"
8
 
 
9
7
        "github.com/juju/cmd"
10
8
        "github.com/juju/errors"
11
9
        "github.com/juju/gnuflag"
 
10
        "github.com/juju/utils/clock"
12
11
        "gopkg.in/juju/names.v2"
13
12
 
14
13
        "github.com/juju/juju/api/usermanager"
47
46
type infoCommandBase struct {
48
47
        modelcmd.ControllerCommandBase
49
48
        api       UserInfoAPI
 
49
        clock     clock.Clock
50
50
        exactTime bool
51
51
        out       cmd.Output
52
52
}
56
56
}
57
57
 
58
58
func NewShowUserCommand() cmd.Command {
59
 
        return modelcmd.WrapController(&infoCommand{})
 
59
        return modelcmd.WrapController(&infoCommand{
 
60
                infoCommandBase: infoCommandBase{
 
61
                        clock: clock.WallClock,
 
62
                },
 
63
        })
60
64
}
61
65
 
62
66
// infoCommand retrieves information about a single user.
135
139
 
136
140
func (c *infoCommandBase) apiUsersToUserInfoSlice(users []params.UserInfo) []UserInfo {
137
141
        var output []UserInfo
138
 
        // TODO(perrito666) 2016-05-02 lp:1558657
139
 
        var now = time.Now()
 
142
        var now = c.clock.Now()
140
143
        for _, info := range users {
141
144
                outInfo := UserInfo{
142
145
                        Username:    info.Username,