Restapi for stop fails if ?t=int not present

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
This commit is contained in:
Srini Brahmaroutu
2015-05-07 15:43:50 +00:00
parent a1aff84480
commit 68e9c07850
2 changed files with 20 additions and 4 deletions
+1 -4
View File
@@ -1040,10 +1040,7 @@ func (s *Server) postContainersStop(version version.Version, w http.ResponseWrit
return fmt.Errorf("Missing parameter")
}
seconds, err := strconv.Atoi(r.Form.Get("t"))
if err != nil {
return err
}
seconds, _ := strconv.Atoi(r.Form.Get("t"))
if err := s.daemon.ContainerStop(vars["name"], seconds); err != nil {
if err.Error() == "Container already stopped" {