Add typo in remove all. Ensure tmpDir is removed

This commit is contained in:
Michael Crosby 2013-11-18 12:34:34 -08:00 committed by Frederick F. Kautz IV
parent 0ef6fed5c7
commit 9de4590498

View file

@ -208,6 +208,8 @@ func (srv *Server) ImageExport(name string, out io.Writer) error {
if err != nil {
return err
}
defer os.RemoveAll(tempdir)
utils.Debugf("Serializing %s", name)
rootRepo := srv.runtime.repositories.Repositories[name]
@ -219,7 +221,7 @@ func (srv *Server) ImageExport(name string, out io.Writer) error {
if err := os.Mkdir(tmpImageDir, os.ModeDir); err != nil {
return err
}
defer os.RemoveAll(tempdir)
defer os.RemoveAll(tmpImageDir)
var version = "1.0"
var versionBuf = []byte(version)
@ -277,7 +279,6 @@ func (srv *Server) ImageExport(name string, out io.Writer) error {
if err != nil {
return err
}
defer os.RemoveAll(tempdir)
if _, err := io.Copy(out, fs); err != nil {
return err