Index: state/apiserver/uniter/uniter.go |
=== modified file 'state/apiserver/uniter/uniter.go' |
--- state/apiserver/uniter/uniter.go 2013-09-02 15:56:26 +0000 |
+++ state/apiserver/uniter/uniter.go 2013-09-03 11:49:29 +0000 |
@@ -7,7 +7,6 @@ |
import ( |
"fmt" |
- "strconv" |
"launchpad.net/juju-core/charm" |
"launchpad.net/juju-core/errors" |
@@ -613,18 +612,11 @@ |
} |
func (u *UniterAPI) getRelationAndUnit(canAccess common.AuthFunc, relTag, unitTag string) (*state.Relation, *state.Unit, error) { |
- _, id, err := names.ParseTag(relTag, names.RelationTagKind) |
- if err != nil { |
- return nil, nil, common.ErrPerm |
- } |
- // TODO(dimitern): Once the relation tags have a different format |
- // (e.g. "relation-service1@name1+service2@name2"), change the |
- // following code accordingly. |
- relId, err := strconv.Atoi(id) |
- if err != nil { |
- return nil, nil, common.ErrPerm |
- } |
- rel, err := u.st.Relation(relId) |
+ _, key, err := names.ParseTag(relTag, names.RelationTagKind) |
+ if err != nil { |
+ return nil, nil, common.ErrPerm |
+ } |
+ rel, err := u.st.KeyRelation(key) |
if errors.IsNotFoundError(err) { |
return nil, nil, common.ErrPerm |
} else if err != nil { |