Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1561)

Side by Side Diff: cmd/juju/removeunit.go

Issue 6700048: juju: remove RemoveUnit facility (Closed)
Patch Set: juju: remove RemoveUnit facility Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « [revision details] ('k') | cmd/juju/removeunit_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package main 1 package main
2 2
3 import ( 3 import (
4 "errors" 4 "errors"
5 "fmt" 5 "fmt"
6 6
7 "launchpad.net/gnuflag" 7 "launchpad.net/gnuflag"
8 "launchpad.net/juju-core/cmd" 8 "launchpad.net/juju-core/cmd"
9 "launchpad.net/juju-core/juju" 9 "launchpad.net/juju-core/juju"
10 "launchpad.net/juju-core/state" 10 "launchpad.net/juju-core/state"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 defer conn.Close() 47 defer conn.Close()
48 var units []*state.Unit 48 var units []*state.Unit
49 for _, name := range c.UnitNames { 49 for _, name := range c.UnitNames {
50 unit, err := conn.State.Unit(name) 50 unit, err := conn.State.Unit(name)
51 if err != nil { 51 if err != nil {
52 return err 52 return err
53 } 53 }
54 units = append(units, unit) 54 units = append(units, unit)
55 } 55 }
56 » return conn.RemoveUnits(units...) 56 » for _, unit := range units {
57 » » // TODO(dfc) the MA should call UnassignFromMachine(), but it do esn't.·
58 » » // Unless someone does, the machine cannot be reused by other ch arms.
59 » » if err := unit.UnassignFromMachine(); err != nil {
60 » » » return err
61 » » }
62 » » if err := unit.EnsureDying(); err != nil {
63 » » » return err
64 » » }
65 » }
66 » return nil
57 } 67 }
OLDNEW
« no previous file with comments | « [revision details] ('k') | cmd/juju/removeunit_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b