~go-bot/juju-core/trunk

« back to all changes in this revision

Viewing changes to state/export_test.go

  • Committer: Tarmac
  • Author(s): Frank Mueller
  • Date: 2013-09-27 15:54:12 UTC
  • mfrom: (1880.1.8 juju-core)
  • Revision ID: tarmac-20130927155412-7jg4vd1xuikq4umy
[r=themue],[bug=1224568] uniter: add hook error status data

With this CL information about a failing hook and,
if possible, the relation id and the remote unit are
written into the status data of the status doc.

https://codereview.appspot.com/14030043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        "launchpad.net/juju-core/charm"
16
16
        "launchpad.net/juju-core/environs/config"
17
17
        "launchpad.net/juju-core/instance"
18
 
        "launchpad.net/juju-core/state/api/params"
19
18
        "launchpad.net/juju-core/testing"
20
19
)
21
20
 
182
181
func ParseTag(st *State, tag string) (string, string, error) {
183
182
        return st.parseTag(tag)
184
183
}
185
 
 
186
 
// StatusData returns the additional status data of a machine.
187
 
// Outside the tests it is returned by a watcher.
188
 
func MachineStatusData(m *Machine) (params.StatusData, error) {
189
 
        doc, err := getStatus(m.st, m.globalKey())
190
 
        if err != nil {
191
 
                return nil, err
192
 
        }
193
 
        return doc.StatusData, nil
194
 
}
195
 
 
196
 
// StatusData returns the additional status data of a unit.
197
 
// Outside the tests it is returned by a watcher.
198
 
func UnitStatusData(u *Unit) (params.StatusData, error) {
199
 
        doc, err := getStatus(u.st, u.globalKey())
200
 
        if err != nil {
201
 
                return nil, err
202
 
        }
203
 
        return doc.StatusData, nil
204
 
}