~rogpeppe/juju-core/256-more-status

« back to all changes in this revision

Viewing changes to cmd/juju/destroymachine.go

statecmd: don't use juju.Conn unnecessarily

There's an associated cost when the API uses juju.Conn,
so we want to avoid it when reasonable.
This change moves some operations from juju into
state because they don't require juju.Conn's associated
Environ.

R=fwereade, dimitern
CC=
https://codereview.appspot.com/7945044

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
                return err
43
43
        }
44
44
        defer conn.Close()
45
 
        return conn.DestroyMachines(c.MachineIds...)
 
45
        return conn.State.DestroyMachines(c.MachineIds...)
46
46
}