More thorough test case, use container.Stop() instead of lxc-kill,

use setStopped() during the restore step
This commit is contained in:
shin-
2013-04-02 07:01:43 -07:00
parent 8edf0ca7f3
commit c780ff5ae7
2 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -136,14 +136,14 @@ func (runtime *Runtime) Register(container *Container) error {
}
// FIXME: if the container is supposed to be running but is not, auto restart it?
// If the container is supposed to be running, make sure of if
// If the container is supposed to be running, make sure of it
if container.State.Running {
if output, err := exec.Command("lxc-info", "-n", container.Id).CombinedOutput(); err != nil {
return err
} else {
if !strings.Contains(string(output), "RUNNING") {
Debugf("Container %s was supposed to be running be is not.", container.Id)
container.State.Running = false
container.State.setStopped(-127)
if err := container.ToDisk(); err != nil {
return err
}