func (a *MachineAgent) setMachineStatus(apiState *api.State, status params.Status, info string) error { tag := a.Tag().(names.MachineTag) machine, err := apiState.Machiner().Machine(tag) if err != nil { return errors.Trace(err) } if err := machine.SetStatus(status, info, nil); err != nil { return errors.Trace(err) } return nil }