fix: software
This commit is contained in:
@@ -700,13 +700,21 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
} else if fileType == 2 {
|
} else if fileType == 2 {
|
||||||
dpkgCmd := fmt.Sprintf("sudo dpkg -i --force-all '%s'", filePath)
|
dpkgCmd := fmt.Sprintf("sudo dpkg -i --force-all '%s'", filePath)
|
||||||
cmd := exec.Command("ssh", sshHost, dpkgCmd)
|
cmd := exec.Command("ssh", sshHost, dpkgCmd)
|
||||||
out, err := cmd.CombinedOutput()
|
var stdout, stderr bytes.Buffer
|
||||||
log.Debugf("Exec output: %v", string(out))
|
cmd.Stdout = &stdout
|
||||||
|
cmd.Stderr = &stderr
|
||||||
|
|
||||||
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Faile to execute dpkg command:", err)
|
log.Error("Faile to execute dpkg command: %v, err: %s", err, stderr.String())
|
||||||
services.ResponseInternalServerError500ProcessError(w, err)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
// out, err := cmd.CombinedOutput()
|
||||||
|
// log.Debugf("Exec output: %v", string(out))
|
||||||
|
// if err != nil {
|
||||||
|
// log.Error("Faile to execute dpkg command:", err)
|
||||||
|
// services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
err := global.ErrCMUnknownSoftwareFormat
|
err := global.ErrCMUnknownSoftwareFormat
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user