~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to state/relation.go

Merge trunk and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        "labix.org/v2/mgo/bson"
8
8
        "labix.org/v2/mgo/txn"
9
9
        "launchpad.net/juju-core/charm"
10
 
        "launchpad.net/juju-core/trivial"
 
10
        "launchpad.net/juju-core/utils"
11
11
        "sort"
12
12
        "strconv"
13
13
        "strings"
85
85
// Destroy ensures that the relation will be removed at some point; if no units
86
86
// are currently in scope, it will be removed immediately.
87
87
func (r *Relation) Destroy() (err error) {
88
 
        defer trivial.ErrorContextf(&err, "cannot destroy relation %q", r)
 
88
        defer utils.ErrorContextf(&err, "cannot destroy relation %q", r)
89
89
        if len(r.doc.Endpoints) == 1 && r.doc.Endpoints[0].Role == charm.RolePeer {
90
90
                return fmt.Errorf("is a peer relation")
91
91
        }