~go-bot/juju-core/trunk

« back to all changes in this revision

Viewing changes to state/service.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2014-05-22 11:37:17 UTC
  • mfrom: (1679.1.11 juju-core)
  • Revision ID: tarmac-20140522113717-99dhnikcznpjpwrw
[r=fwereade],[bug=1192433] state: set departed on dying units' relations

This ended up including:

  * stopping using magic strings in cleanup
  * drawing a clear distinction between "joined" and "in scope" (which
    accounts for most of the lines of changes)

...but did *not* include:

  * fixing the name of the Uniter.JoinedRelations API, because I want to
    wait for API versioning

https://codereview.appspot.com/94540043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
        // about is that *some* unit is, or is not, keeping the service from
190
190
        // being removed: the difference between 1 unit and 1000 is irrelevant.
191
191
        if s.doc.UnitCount > 0 {
192
 
                ops = append(ops, s.st.newCleanupOp("units", s.doc.Name+"/"))
 
192
                ops = append(ops, s.st.newCleanupOp(cleanupUnitsForDyingService, s.doc.Name+"/"))
193
193
                notLastRefs = append(notLastRefs, bson.D{{"unitcount", bson.D{{"$gt", 0}}}}...)
194
194
        } else {
195
195
                notLastRefs = append(notLastRefs, bson.D{{"unitcount", 0}}...)