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

« back to all changes in this revision

Viewing changes to worker/uniter/context.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:
142
142
        return ids
143
143
}
144
144
 
145
 
func (ctx *HookContext) OwnerTag() (string, bool) {
146
 
        return "user-name", true
 
145
func (ctx *HookContext) OwnerTag() (string, bool) { //TODO Return error
 
146
        service, err := ctx.unit.Service()
 
147
        if err != nil {
 
148
                return "", false
 
149
        }
 
150
 
 
151
        tag, err := service.GetOwnerTag()
 
152
        if err != nil {
 
153
                return "", false
 
154
        }
 
155
        return tag, true
147
156
}
148
157
 
149
158
// hookVars returns an os.Environ-style list of strings necessary to run a hook