mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>
This commit is contained in:
@@ -15,13 +15,13 @@ func (daemon *Daemon) ContainerRestart(job *engine.Job) engine.Status {
|
||||
if job.EnvExists("t") {
|
||||
t = job.GetenvInt("t")
|
||||
}
|
||||
if container := daemon.Get(name); container != nil {
|
||||
if err := container.Restart(int(t)); err != nil {
|
||||
return job.Errorf("Cannot restart container %s: %s\n", name, err)
|
||||
}
|
||||
container.LogEvent("restart")
|
||||
} else {
|
||||
return job.Errorf("No such container: %s\n", name)
|
||||
container, err := daemon.Get(name)
|
||||
if err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
if err := container.Restart(int(t)); err != nil {
|
||||
return job.Errorf("Cannot restart container %s: %s\n", name, err)
|
||||
}
|
||||
container.LogEvent("restart")
|
||||
return engine.StatusOK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user