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

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/controller/listcontrollersconverters.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        ModelName      string   `yaml:"current-model,omitempty" json:"current-model,omitempty"`
24
24
        User           string   `yaml:"user,omitempty" json:"user,omitempty"`
25
25
        Server         string   `yaml:"recent-server,omitempty" json:"recent-server,omitempty"`
26
 
        Servers        []string `yaml:"servers,flow" json:"servers"`
27
26
        ControllerUUID string   `yaml:"uuid" json:"uuid"`
28
27
        APIEndpoints   []string `yaml:"api-endpoints,flow" json:"api-endpoints"`
29
28
        CACert         string   `yaml:"ca-cert" json:"ca-cert"`
46
45
        controllers := map[string]ControllerItem{}
47
46
        for controllerName, details := range storeControllers {
48
47
                serverName := ""
49
 
                // The most recently connected-to host name
 
48
                // The most recently connected-to address
50
49
                // is the first in the list.
51
 
                if len(details.Servers) > 0 {
52
 
                        serverName = details.Servers[0]
 
50
                if len(details.APIEndpoints) > 0 {
 
51
                        serverName = details.APIEndpoints[0]
53
52
                }
54
53
 
55
54
                var userName, modelName string
81
80
                        ModelName:      modelName,
82
81
                        User:           userName,
83
82
                        Server:         serverName,
84
 
                        Servers:        details.Servers,
85
83
                        APIEndpoints:   details.APIEndpoints,
86
84
                        ControllerUUID: details.ControllerUUID,
87
85
                        CACert:         details.CACert,