1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Remove job from execInspect

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-04-12 00:15:34 +02:00
parent e3dd323336
commit 621ee1f6a4
3 changed files with 11 additions and 16 deletions

View file

@ -1151,9 +1151,14 @@ func getExecByID(eng *engine.Engine, version version.Version, w http.ResponseWri
if vars == nil {
return fmt.Errorf("Missing parameter 'id'")
}
var job = eng.Job("execInspect", vars["id"])
streamJSON(job, w, false)
return job.Run()
d := getDaemon(eng)
eConfig, err := d.ContainerExecInspect(vars["id"])
if err != nil {
return err
}
return writeJSON(w, http.StatusOK, eConfig)
}
func getImagesByName(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

View file

@ -129,7 +129,6 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
"stop": daemon.ContainerStop,
"execCreate": daemon.ContainerExecCreate,
"execStart": daemon.ContainerExecStart,
"execInspect": daemon.ContainerExecInspect,
} {
if err := eng.Register(name, method); err != nil {
return err

View file

@ -80,20 +80,11 @@ func (daemon *Daemon) ContainerInspect(job *engine.Job) error {
return nil
}
func (daemon *Daemon) ContainerExecInspect(job *engine.Job) error {
if len(job.Args) != 1 {
return fmt.Errorf("usage: %s ID", job.Name)
}
id := job.Args[0]
func (daemon *Daemon) ContainerExecInspect(id string) (*execConfig, error) {
eConfig, err := daemon.getExecConfig(id)
if err != nil {
return err
return nil, err
}
b, err := json.Marshal(*eConfig)
if err != nil {
return err
}
job.Stdout.Write(b)
return nil
return eConfig, nil
}