Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(673)

Unified Diff: cmd/jujud/unit.go

Issue 6567067: cmd/jujud: allow for a clean exit
Patch Set: Created 12 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cmd/jujud/unit.go
=== modified file 'cmd/jujud/unit.go'
--- cmd/jujud/unit.go 2012-09-28 09:34:09 +0000
+++ cmd/jujud/unit.go 2012-09-28 09:57:23 +0000
@@ -57,6 +57,9 @@
return ug
}
}
+ if err == uniter.ErrDead {
niemeyer 2012/09/28 14:54:54 Same as for machine.
rog 2012/09/28 15:39:45 Done.
+ return nil
+ }
log.Printf("uniter: %v", err)
select {
case <-a.tomb.Dying():
@@ -76,6 +79,9 @@
}
defer st.Close()
unit, err := st.Unit(a.UnitName)
+ if state.IsNotFound(err) || err == nil && unit.Life() == state.Dead {
+ return uniter.ErrDead
+ }
if err != nil {
return err
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b