~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/machine/base.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:
41
41
        })
42
42
}
43
43
 
44
 
var connectionError = `Unable to connect to model %q.
45
 
Please check your credentials or use 'juju bootstrap' to create a new model.
46
 
 
47
 
Error details:
48
 
%v
49
 
`
50
44
var newAPIClientForMachines = func(c *baselistMachinesCommand) (statusAPI, error) {
51
45
        if c.api != nil {
52
46
                return c.api, nil
58
52
func (c *baselistMachinesCommand) Run(ctx *cmd.Context) error {
59
53
        apiclient, err := newAPIClientForMachines(c)
60
54
        if err != nil {
61
 
                return errors.Errorf(connectionError, c.ConnectionName(), err)
 
55
                return errors.Trace(err)
62
56
        }
63
57
        defer apiclient.Close()
64
58