~vds/juju-core/add-owner-to-service

« back to all changes in this revision

Viewing changes to state/api/uniter/service.go

  • Committer: Matthew Williams
  • Date: 2013-10-03 15:10:48 UTC
  • Revision ID: mattyw@me.com-20131003151048-r2pws7r13e7iubnb
making sure the owner-get tool is getting the user from the api

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
        }
127
127
        return nil, false, fmt.Errorf("%q has no charm url set", s.tag)
128
128
}
 
129
 
 
130
func (s *Service) GetOwnerTag() (string, error) {
 
131
        var result params.StringResult
 
132
        args := params.Entities{
 
133
                Entities: []params.Entity{{Tag: s.tag}},
 
134
        }
 
135
        err := s.st.caller.Call("Uniter", "", "GetOwnerTag", args, &result)
 
136
        if err != nil {
 
137
                return "", err
 
138
        }
 
139
        if result.Error != nil {
 
140
                return "", result.Error
 
141
        }
 
142
        return result.Result, nil
 
143
}