Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
incorporated iza's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf committed Aug 8, 2017
1 parent feb1987 commit b0dd0d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mgmt/rest/v2/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (s *apiV2) loadPlugin(w http.ResponseWriter, r *http.Request, _ httprouter.
Write(ec, rb, w)
return
}
cleanUpTempFiles(rp)
defer cleanUpTempFiles(rp)
Write(201, catalogedPluginBody(r.Host, pl), w)
}
}
Expand All @@ -309,9 +309,9 @@ func createTempFile(b []byte, fn string) (string, error) {
}

func cleanUpTempFiles(rp *core.RequestedPlugin) {
defer os.Remove(rp.CACertPaths())
defer os.Remove(rp.CertPath())
defer os.Remove(rp.KeyPath())
os.Remove(rp.CACertPaths())
os.Remove(rp.CertPath())
os.Remove(rp.KeyPath())
}

func pluginParameters(p httprouter.Params) (string, string, int, map[string]interface{}, serror.SnapError) {
Expand Down

0 comments on commit b0dd0d7

Please sign in to comment.