Permalink
Browse files

Build OK

  • Loading branch information...
1 parent ffb3cec commit e515412e52504a319f92635ed7dd54964c7ed331 @cloudhead cloudhead committed Sep 13, 2012
Showing with 357 additions and 658 deletions.
  1. +1 −1 codec.go
  2. +4 −0 dir.go
  3. +14 −6 event.go
  4. +283 −97 instance.go
  5. +8 −195 instance_test.go
  6. +14 −6 proctype.go
  7. +0 −316 ticket.go
  8. +10 −10 ticket_test.go
  9. +23 −27 visor.go
View
@@ -70,7 +70,7 @@ func (*intCodec) Decode(input []byte) (interface{}, error) {
type listCodec struct{}
func (*listCodec) Encode(input interface{}) ([]byte, error) {
- return []byte(strings.Join(input.([]string), " ")), nil
+ return []byte(strings.TrimSpace(strings.Join(input.([]string), " "))), nil
}
func (*listCodec) Decode(input []byte) (interface{}, error) {
return strings.Fields(string(input)), nil
View
4 dir.go
@@ -30,6 +30,10 @@ func (p *dir) prefix(path string, paths ...string) (result string) {
return
}
+func (p *dir) fastForward(rev int64) *dir {
+ return &dir{p.Snapshot.FastForward(rev), p.Name}
+}
+
func (p *dir) String() (dir string) {
return p.Name
}
View
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/soundcloud/doozer"
"regexp"
+ "strconv"
)
// An Event represents a change to a file in the registry.
@@ -177,9 +178,16 @@ func getEventInfo(s Snapshot, ev *Event) (info interface{}, err error) {
}
case EvInsReg, EvInsStart, EvInsExit, EvInsFail, EvInsDead:
var i *Instance
+ var id int64
e := ev.Emitter
- i, err = GetInstance(s, e["instance"])
+
+ id, err = strconv.ParseInt(e["instance"], 10, 64)
+ if err != nil {
+ return
+ }
+
+ i, err = GetInstance(s, id)
if err != nil {
fmt.Printf("error getting instance: %s\n", err)
return
@@ -272,14 +280,14 @@ func parseEvent(src *doozer.Event) *Event {
break
}
- switch State(src.Body) {
- case InsStateStarted:
+ switch InsStatus(src.Body) {
+ case InsStatusStarted:
etype = EvInsStart
- case InsStateExited:
+ case InsStatusExited:
etype = EvInsExit
- case InsStateFailed:
+ case InsStatusFailed:
etype = EvInsFail
- case InsStateDead:
+ case InsStatusDead:
etype = EvInsDead
}
case pathSrv:
Oops, something went wrong.

0 comments on commit e515412

Please sign in to comment.